Re: [netfilter-nf:testing 11/20] net/netfilter/ipset/ip_set_hash_gen.h:379:21: warning: result of comparison of constant -1 with expression of type 'u8' (aka 'unsigned char') is always false

Florian Westphal <[email protected]>
Newsgroups gmane.comp.security.firewalls.netfilter.devel
Message-ID <[email protected]>
kernel test robot <[email protected]> wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git testing
> head:   c2fbcb9151957c3d921a7441cf080e49eb13b05d
> commit: a900abcb974bae821a5d4ae79ad3442808915416 [11/20] netfilter: ipset: rework cidr bookkeeping
> config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20260708/[email protected]/config)
> compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260708/[email protected]/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <[email protected]>
> | Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
> 
> All warnings (new ones prefixed by >>):
> 
>    In file included from net/netfilter/ipset/ip_set_hash_ipportnet.c:131:
> >> net/netfilter/ipset/ip_set_hash_gen.h:379:21: warning: result of comparison of constant -1 with expression of type 'u8' (aka 'unsigned char') is always false [-Wtautological-constant-out-of-range-compare]
>      379 |         if (unlikely(found == -1))
>          |                      ~~~~~ ^  ~~
>    include/linux/compiler.h:77:42: note: expanded from macro 'unlikely'
>       77 | # define unlikely(x)    __builtin_expect(!!(x), 0)
>          |                                             ^
>    In file included from net/netfilter/ipset/ip_set_hash_ipportnet.c:391:
> >> net/netfilter/ipset/ip_set_hash_gen.h:379:21: warning: result of comparison of constant -1 with expression of type 'u8' (aka 'unsigned char') is always false [-Wtautological-constant-out-of-range-compare]
>      379 |         if (unlikely(found == -1))
>          |                      ~~~~~ ^  ~~
>    include/linux/compiler.h:77:42: note: expanded from macro 'unlikely'
>       77 | # define unlikely(x)    __builtin_expect(!!(x), 0)
>          |                                             ^
>    2 warnings generated.

FYI, I removed this patch from the batch that I sent to net tree.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.