Skip to content

Commit e8b03ae

Browse files
Minjie Dushuahkh
authored andcommitted
tools: timers: fix freq average calculation
Delete a duplicate assignment from this function implementation. The note means ppm is average of the two actual freq samples. But ppm have a duplicate assignment. Signed-off-by: Minjie Du <duminjie@vivo.com> Acked-by: John Stultz <jstultz@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent b33b873 commit e8b03ae

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tools/testing/selftests/timers/raw_skew.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ int main(int argc, char **argv)
129129
printf("%lld.%i(est)", eppm/1000, abs((int)(eppm%1000)));
130130

131131
/* Avg the two actual freq samples adjtimex gave us */
132-
ppm = (tx1.freq + tx2.freq) * 1000 / 2;
133-
ppm = (long long)tx1.freq * 1000;
132+
ppm = (long long)(tx1.freq + tx2.freq) * 1000 / 2;
134133
ppm = shift_right(ppm, 16);
135134
printf(" %lld.%i(act)", ppm/1000, abs((int)(ppm%1000)));
136135

0 commit comments

Comments
 (0)