Re: [PATCH net-next] netfilter: nft_payload: Use csum_replace4() instead of opencoding

From: kernel test robot
Date: Thu Aug 14 2025 - 02:27:32 EST


Hi Christophe,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url: https://github.com/intel-lab-lkp/linux/commits/Christophe-Leroy/netfilter-nft_payload-Use-csum_replace4-instead-of-opencoding/20250812-183440
base: net-next/main
patch link: https://lore.kernel.org/r/e98467a942d65d2dc45dcf8ff809b43d4a3769eb.1754992552.git.christophe.leroy%40csgroup.eu
patch subject: [PATCH net-next] netfilter: nft_payload: Use csum_replace4() instead of opencoding
config: x86_64-randconfig-122-20250814 (https://download.01.org/0day-ci/archive/20250814/202508141336.K6vIBjy1-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250814/202508141336.K6vIBjy1-lkp@xxxxxxxxx/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 <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508141336.K6vIBjy1-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> net/netfilter/nft_payload.c:687:28: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected restricted __be32 [usertype] from @@ got restricted __wsum [usertype] fsum @@
net/netfilter/nft_payload.c:687:28: sparse: expected restricted __be32 [usertype] from
net/netfilter/nft_payload.c:687:28: sparse: got restricted __wsum [usertype] fsum
>> net/netfilter/nft_payload.c:687:34: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected restricted __be32 [usertype] to @@ got restricted __wsum [usertype] tsum @@
net/netfilter/nft_payload.c:687:34: sparse: expected restricted __be32 [usertype] to
net/netfilter/nft_payload.c:687:34: sparse: got restricted __wsum [usertype] tsum
>> net/netfilter/nft_payload.c:687:28: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected restricted __be32 [usertype] from @@ got restricted __wsum [usertype] fsum @@
net/netfilter/nft_payload.c:687:28: sparse: expected restricted __be32 [usertype] from
net/netfilter/nft_payload.c:687:28: sparse: got restricted __wsum [usertype] fsum
>> net/netfilter/nft_payload.c:687:34: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected restricted __be32 [usertype] to @@ got restricted __wsum [usertype] tsum @@
net/netfilter/nft_payload.c:687:34: sparse: expected restricted __be32 [usertype] to
net/netfilter/nft_payload.c:687:34: sparse: got restricted __wsum [usertype] tsum

vim +687 net/netfilter/nft_payload.c

684
685 static inline void nft_csum_replace(__sum16 *sum, __wsum fsum, __wsum tsum)
686 {
> 687 csum_replace4(sum, fsum, tsum);
688 if (*sum == 0)
689 *sum = CSUM_MANGLED_0;
690 }
691

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki