Skip to content

Commit

Permalink
selftests/net: so_txtime: fix clang issues for target arch PowerPC
Browse files Browse the repository at this point in the history
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 <tannerlove@google.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
tannerlove authored and davem330 committed Jul 27, 2020
1 parent 64f9ede commit b4da96f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/net/so_txtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static bool do_recv_one(int fdr, struct timed_send *ts)
if (rbuf[0] != ts->data)
error(1, 0, "payload mismatch. expected %c", ts->data);

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

return false;
Expand Down

0 comments on commit b4da96f

Please sign in to comment.