Skip to content

Commit

Permalink
tools: timers: fix freq average calculation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Minjie Du authored and Shuah Khan committed Jul 13, 2023
1 parent b33b873 commit e8b03ae
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tools/testing/selftests/timers/raw_skew.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ int main(int argc, char **argv)
printf("%lld.%i(est)", eppm/1000, abs((int)(eppm%1000)));

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

Expand Down

0 comments on commit e8b03ae

Please sign in to comment.