From: Tanner Love <tannerlove.kernel@gmail•com>
To: netdev@vger•kernel.org
Cc: davem@davemloft•net, Tanner Love <tannerlove@google•com>,
Willem de Bruijn <willemb@google•com>
Subject: [PATCH net 3/4] selftests/net: so_txtime: fix clang issues for target arch PowerPC
Date: Mon, 27 Jul 2020 12:25:30 -0400 [thread overview]
Message-ID: <20200727162531.4089654-4-tannerlove.kernel@gmail.com> (raw)
In-Reply-To: <20200727162531.4089654-1-tannerlove.kernel@gmail.com>
From: Tanner Love <tannerlove@google•com>
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>
---
tools/testing/selftests/net/so_txtime.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/so_txtime.c b/tools/testing/selftests/net/so_txtime.c
index ceaad78e9667..3155fbbf644b 100644
--- a/tools/testing/selftests/net/so_txtime.c
+++ b/tools/testing/selftests/net/so_txtime.c
@@ -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;
--
2.28.0.rc0.142.g3c755180ce-goog
next prev parent reply other threads:[~2020-07-27 16:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-27 16:25 [PATCH net 0/4] selftests/net: Fix clang warnings on powerpc Tanner Love
2020-07-27 16:25 ` [PATCH net 1/4] selftests/net: rxtimestamp: fix clang issues for target arch PowerPC Tanner Love
2020-07-27 16:25 ` [PATCH net 2/4] selftests/net: psock_fanout: " Tanner Love
2020-07-27 16:25 ` Tanner Love [this message]
2020-07-27 16:25 ` [PATCH net 4/4] selftests/net: tcp_mmap: fix clang warning " Tanner Love
2020-07-27 19:33 ` Eric Dumazet
2020-07-27 19:57 ` [PATCH net 0/4] selftests/net: Fix clang warnings on powerpc David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200727162531.4089654-4-tannerlove.kernel@gmail.com \
--to=tannerlove.kernel@gmail$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
--cc=tannerlove@google$(echo .)com \
--cc=willemb@google$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox