]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/net: tcp_mmap: fix clang warning for target arch PowerPC
authorTanner Love <tannerlove@google.com>
Mon, 27 Jul 2020 16:25:31 +0000 (12:25 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Jul 2020 19:56:59 +0000 (12:56 -0700)
commitdb207682ffe6fd4146eaf0acb7c900ad03e69074
tree10febb707fb3c16799009b2bf10ceb55f5086933
parent044811e68d308395325b7ca9f4f04000576c0dd3
selftests/net: tcp_mmap: fix clang warning for target arch PowerPC

When size_t maps to unsigned int (e.g. on 32-bit powerpc), then the
comparison with 1<<35 is always true. Clang 9 threw:
warning: result of comparison of constant 34359738368 with \
expression of type 'size_t' (aka 'unsigned int') is always true \
[-Wtautological-constant-out-of-range-compare]
        while (total < FILE_SZ) {

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

Fixes: 6eb59c00f685 ("selftests: net: add tcp_mmap program")
Signed-off-by: Tanner Love <tannerlove@google.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/tcp_mmap.c