summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMinjie Du <duminjie@vivo.com>2023-07-06 06:22:57 +0300
committerShuah Khan <skhan@linuxfoundation.org>2023-07-13 22:32:36 +0300
commite8b03aef194c3c8597f4fb8e58ade1cc1f43001e (patch)
tree95697da70ed1e9e1e768de3d215dde5eb766a8b5 /tools
parentb33b8731566d50aae6e11bd02921452cf3a7e0e7 (diff)
downloadlinux-e8b03aef194c3c8597f4fb8e58ade1cc1f43001e.tar.xz
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/timers/raw_skew.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/testing/selftests/timers/raw_skew.c b/tools/testing/selftests/timers/raw_skew.c
index 5beceeed0d11..6eba203f9da7 100644
--- a/tools/testing/selftests/timers/raw_skew.c
+++ b/tools/testing/selftests/timers/raw_skew.c
@@ -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)));