]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2020 07:58:40 +0000 (09:58 +0200)
commitaa3daddb7f70540b0e9f87927ad0c19f8636f347
tree7c5d3dc83cd6a4a5903be19a7289ab8e4e08707a
parent4fa7dc1ea47eb17ad33f28ed2c58d387f526e708
selftests/net: tcp_mmap: fix clang warning for target arch PowerPC

[ Upstream commit 94b6c13be57cdedb7cf4d33dbcd066fad133f22b ]

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: 192dc405f308 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/net/tcp_mmap.c