Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

The signedness of char is implementation-dependent. Some systems
(including PowerPC and ARM) use unsigned char. Clang 9 threw:
warning: result of comparison of constant -1 with expression of type \
'char' is always true [-Wtautological-constant-out-of-range-compare]
&arg_index)) != -1) {

Tested: make -C tools/testing/selftests TARGETS="net" run_tests

Fixes: 16e781224198 ("selftests/net: Add a test to validate behavior of rx timestamps")
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>

authored by

Tanner Love and committed by
David S. Miller
955cbe91 5fd82200

+1 -2
+1 -2
tools/testing/selftests/net/rxtimestamp.c
··· 329 329 bool all_tests = true; 330 330 int arg_index = 0; 331 331 int failures = 0; 332 - int s, t; 333 - char opt; 332 + int s, t, opt; 334 333 335 334 while ((opt = getopt_long(argc, argv, "", long_options, 336 335 &arg_index)) != -1) {