Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 222dbeca authored by Tanner Love's avatar Tanner Love Committed by Greg Kroah-Hartman
Browse files

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



[ Upstream commit b4da96ffd30bd4a305045ba5c9b0de5d4aa20dc7 ]

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: af5136f9 ("selftests/net: SO_TXTIME with ETF and FQ")
Signed-off-by: default avatarTanner Love <tannerlove@google.com>
Acked-by: default avatarWillem de Bruijn <willemb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d817b2c8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;