Skip to content

Commit 4fa7dc1

Browse files
tannerlovegregkh
authored andcommitted
selftests/net: so_txtime: fix clang issues for target arch PowerPC
[ Upstream commit b4da96f ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 905fcce commit 4fa7dc1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎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)