[linux-next:master 13664/13959] lib/checksum_kunit.c:616:17: sparse: sparse: incorrect type in argument 5 (different base types)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   ad5c60d66016e544c51ed98635a74073f761f45d
commit: 6f4c45cbcb00d649475a3099235e5b4fce569b4b [13664/13959] kunit: Add tests for csum_ipv6_magic and ip_fast_csum
config: x86_64-randconfig-121-20240119 (https://download.01.org/0day-ci/archive/20240120/202401200016.e774FjBx-lkp@xxxxxxxxx/config)
compiler: ClangBuiltLinux clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240120/202401200016.e774FjBx-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/202401200016.e774FjBx-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
   lib/checksum_kunit.c:442:33: sparse:     got int
   lib/checksum_kunit.c:442:41: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:442:41: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:442:41: sparse:     got int
   lib/checksum_kunit.c:442:49: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:442:49: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:442:49: sparse:     got int
   lib/checksum_kunit.c:442:57: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:442:57: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:442:57: sparse:     got int
   lib/checksum_kunit.c:442:65: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:442:65: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:442:65: sparse:     got int
   lib/checksum_kunit.c:442:73: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:442:73: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:442:73: sparse:     got int
   lib/checksum_kunit.c:443:9: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:443:9: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:443:9: sparse:     got int
   lib/checksum_kunit.c:443:17: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:443:17: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:443:17: sparse:     got int
   lib/checksum_kunit.c:443:25: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:443:25: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:443:25: sparse:     got int
   lib/checksum_kunit.c:443:33: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:443:33: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:443:33: sparse:     got int
   lib/checksum_kunit.c:443:41: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:443:41: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:443:41: sparse:     got int
   lib/checksum_kunit.c:443:49: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:443:49: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:443:49: sparse:     got int
   lib/checksum_kunit.c:443:57: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:443:57: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:443:57: sparse:     got int
   lib/checksum_kunit.c:443:65: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:443:65: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:443:65: sparse:     got int
   lib/checksum_kunit.c:443:73: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:443:73: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:443:73: sparse:     got int
   lib/checksum_kunit.c:444:9: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:444:9: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:444:9: sparse:     got int
   lib/checksum_kunit.c:444:17: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:444:17: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:444:17: sparse:     got int
   lib/checksum_kunit.c:444:25: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:444:25: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:444:25: sparse:     got int
   lib/checksum_kunit.c:444:33: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:444:33: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:444:33: sparse:     got int
   lib/checksum_kunit.c:444:41: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:444:41: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:444:41: sparse:     got int
   lib/checksum_kunit.c:444:49: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:444:49: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:444:49: sparse:     got int
   lib/checksum_kunit.c:444:57: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:444:57: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:444:57: sparse:     got int
   lib/checksum_kunit.c:444:65: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:444:65: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:444:65: sparse:     got int
   lib/checksum_kunit.c:444:73: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:444:73: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:444:73: sparse:     got int
   lib/checksum_kunit.c:445:9: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:445:9: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:445:9: sparse:     got int
   lib/checksum_kunit.c:445:17: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:445:17: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:445:17: sparse:     got int
   lib/checksum_kunit.c:445:25: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:445:25: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:445:25: sparse:     got int
   lib/checksum_kunit.c:445:33: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:445:33: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:445:33: sparse:     got int
   lib/checksum_kunit.c:445:41: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:445:41: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:445:41: sparse:     got int
   lib/checksum_kunit.c:445:49: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:445:49: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:445:49: sparse:     got int
   lib/checksum_kunit.c:445:57: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:445:57: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:445:57: sparse:     got int
   lib/checksum_kunit.c:445:65: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:445:65: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:445:65: sparse:     got int
   lib/checksum_kunit.c:445:73: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:445:73: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:445:73: sparse:     got int
   lib/checksum_kunit.c:446:9: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __sum16 @@     got int @@
   lib/checksum_kunit.c:446:9: sparse:     expected restricted __sum16
   lib/checksum_kunit.c:446:9: sparse:     got int
>> lib/checksum_kunit.c:616:17: sparse: sparse: incorrect type in argument 5 (different base types) @@     expected restricted __wsum [usertype] csum @@     got unsigned int [assigned] csum @@
   lib/checksum_kunit.c:616:17: sparse:     expected restricted __wsum [usertype] csum
   lib/checksum_kunit.c:616:17: sparse:     got unsigned int [assigned] csum
>> lib/checksum_kunit.c:616:17: sparse: sparse: incorrect type in argument 5 (different base types) @@     expected restricted __wsum [usertype] csum @@     got unsigned int [assigned] csum @@
   lib/checksum_kunit.c:616:17: sparse:     expected restricted __wsum [usertype] csum
   lib/checksum_kunit.c:616:17: sparse:     got unsigned int [assigned] csum

vim +616 lib/checksum_kunit.c

   593	
   594	static void test_csum_ipv6_magic(struct kunit *test)
   595	{
   596		const struct in6_addr *saddr;
   597		const struct in6_addr *daddr;
   598		unsigned int len;
   599		unsigned char proto;
   600		unsigned int csum;
   601	
   602		const int daddr_offset = sizeof(struct in6_addr);
   603		const int len_offset = sizeof(struct in6_addr) + sizeof(struct in6_addr);
   604		const int proto_offset = sizeof(struct in6_addr) + sizeof(struct in6_addr) +
   605				     sizeof(int);
   606		const int csum_offset = sizeof(struct in6_addr) + sizeof(struct in6_addr) +
   607				    sizeof(int) + sizeof(char);
   608	
   609		for (int i = 0; i < NUM_IPv6_TESTS; i++) {
   610			saddr = (const struct in6_addr *)(random_buf + i);
   611			daddr = (const struct in6_addr *)(random_buf + i +
   612							  daddr_offset);
   613			len = *(unsigned int *)(random_buf + i + len_offset);
   614			proto = *(random_buf + i + proto_offset);
   615			csum = *(unsigned int *)(random_buf + i + csum_offset);
 > 616			CHECK_EQ(expected_csum_ipv6_magic[i],
   617				 csum_ipv6_magic(saddr, daddr, len, proto, csum));
   618		}
   619	}
   620	

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux