Skip to content

Commit b4da96f

Browse files
tannerlovedavem330
authored andcommitted
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: af5136f ("selftests/net: SO_TXTIME with ETF and FQ") Signed-off-by: Tanner Love <[email protected]> Acked-by: Willem de Bruijn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 64f9ede commit b4da96f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/net/so_txtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static bool do_recv_one(int fdr, struct timed_send *ts)
121121
if (rbuf[0] != ts->data)
122122
error(1, 0, "payload mismatch. expected %c", ts->data);
123123

124-
if (labs(tstop - texpect) > cfg_variance_us)
124+
if (llabs(tstop - texpect) > cfg_variance_us)
125125
error(1, 0, "exceeds variance (%d us)", cfg_variance_us);
126126

127127
return false;

0 commit comments

Comments
 (0)