Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/net: so_txtime: fix clang issues for target arch PowerPC

On powerpcle, int64_t maps to long long. Clang 9 threw:
warning: absolute value function 'labs' given an argument of type \
'long long' but has parameter of type 'long' which may cause \
truncation of value [-Wabsolute-value]
if (labs(tstop - texpect) > cfg_variance_us)

Tested: make -C tools/testing/selftests TARGETS="net" run_tests

Fixes: af5136f95045 ("selftests/net: SO_TXTIME with ETF and FQ")
Signed-off-by: Tanner Love <tannerlove@google.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Tanner Love and committed by
David S. Miller
b4da96ff 64f9ede2

+1 -1
+1 -1
tools/testing/selftests/net/so_txtime.c
··· 121 121 if (rbuf[0] != ts->data) 122 122 error(1, 0, "payload mismatch. expected %c", ts->data); 123 123 124 - if (labs(tstop - texpect) > cfg_variance_us) 124 + if (llabs(tstop - texpect) > cfg_variance_us) 125 125 error(1, 0, "exceeds variance (%d us)", cfg_variance_us); 126 126 127 127 return false;