net/dccp/ccids/ccid3.c:474:25: sparse: sparse: incorrect type in assignment (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/torvalds/linux.git master
head:   a90af8f15bdc9449ee2d24e1d73fa3f7e8633f81
commit: d991bb1c8da842a2a0b9dc83b1005e655783f861 include/linux/compiler-gcc.h: sparse can do constant folding of __builtin_bswap*()
date:   7 months ago
config: mips-randconfig-s032-20211116 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d991bb1c8da842a2a0b9dc83b1005e655783f861
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout d991bb1c8da842a2a0b9dc83b1005e655783f861
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)
   command-line: note: in included file:
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
   builtin:0:0: sparse: this was the original definition
>> net/dccp/ccids/ccid3.c:474:25: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be32 [usertype] opt_val @@     got unsigned int [usertype] @@
   net/dccp/ccids/ccid3.c:474:25: sparse:     expected restricted __be32 [usertype] opt_val
   net/dccp/ccids/ccid3.c:474:25: sparse:     got unsigned int [usertype]
   net/dccp/ccids/ccid3.c:478:39: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] tx_x_recv @@     got restricted __be32 [usertype] opt_val @@
   net/dccp/ccids/ccid3.c:478:39: sparse:     expected unsigned long long [usertype] tx_x_recv
   net/dccp/ccids/ccid3.c:478:39: sparse:     got restricted __be32 [usertype] opt_val
   net/dccp/ccids/ccid3.c:485:64: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] loss_event_rate @@     got restricted __be32 [usertype] opt_val @@
   net/dccp/ccids/ccid3.c:485:64: sparse:     expected unsigned int [usertype] loss_event_rate
   net/dccp/ccids/ccid3.c:485:64: sparse:     got restricted __be32 [usertype] opt_val

vim +474 net/dccp/ccids/ccid3.c

7c657876b63cb1 Arnaldo Carvalho de Melo 2005-08-09  456  
4874c131d79695 Gerrit Renker            2010-09-19  457  static int ccid3_hc_tx_parse_options(struct sock *sk, u8 packet_type,
4874c131d79695 Gerrit Renker            2010-09-19  458  				     u8 option, u8 *optval, u8 optlen)
7c657876b63cb1 Arnaldo Carvalho de Melo 2005-08-09  459  {
996ccf49005662 Gerrit Renker            2009-10-05  460  	struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk);
76fd1e87d9456c Gerrit Renker            2007-10-24  461  	__be32 opt_val;
7c657876b63cb1 Arnaldo Carvalho de Melo 2005-08-09  462  
410e27a49bb98b Gerrit Renker            2008-09-09  463  	switch (option) {
37efb03fbd0935 Gerrit Renker            2010-09-14  464  	case TFRC_OPT_RECEIVE_RATE:
410e27a49bb98b Gerrit Renker            2008-09-09  465  	case TFRC_OPT_LOSS_EVENT_RATE:
4874c131d79695 Gerrit Renker            2010-09-19  466  		/* Must be ignored on Data packets, cf. RFC 4342 8.3 and 8.5 */
4874c131d79695 Gerrit Renker            2010-09-19  467  		if (packet_type == DCCP_PKT_DATA)
4874c131d79695 Gerrit Renker            2010-09-19  468  			break;
4874c131d79695 Gerrit Renker            2010-09-19  469  		if (unlikely(optlen != 4)) {
37efb03fbd0935 Gerrit Renker            2010-09-14  470  			DCCP_WARN("%s(%p), invalid len %d for %u\n",
4874c131d79695 Gerrit Renker            2010-09-19  471  				  dccp_role(sk), sk, optlen, option);
37efb03fbd0935 Gerrit Renker            2010-09-14  472  			return -EINVAL;
7c657876b63cb1 Arnaldo Carvalho de Melo 2005-08-09  473  		}
4874c131d79695 Gerrit Renker            2010-09-19 @474  		opt_val = ntohl(get_unaligned((__be32 *)optval));
37efb03fbd0935 Gerrit Renker            2010-09-14  475  
37efb03fbd0935 Gerrit Renker            2010-09-14  476  		if (option == TFRC_OPT_RECEIVE_RATE) {
536bb20b45dee3 Gerrit Renker            2010-09-19  477  			/* Receive Rate is kept in units of 64 bytes/second */
536bb20b45dee3 Gerrit Renker            2010-09-19  478  			hc->tx_x_recv = opt_val;
536bb20b45dee3 Gerrit Renker            2010-09-19  479  			hc->tx_x_recv <<= 6;
536bb20b45dee3 Gerrit Renker            2010-09-19  480  
410e27a49bb98b Gerrit Renker            2008-09-09  481  			ccid3_pr_debug("%s(%p), RECEIVE_RATE=%u\n",
37efb03fbd0935 Gerrit Renker            2010-09-14  482  				       dccp_role(sk), sk, opt_val);
37efb03fbd0935 Gerrit Renker            2010-09-14  483  		} else {
536bb20b45dee3 Gerrit Renker            2010-09-19  484  			/* Update the fixpoint Loss Event Rate fraction */
536bb20b45dee3 Gerrit Renker            2010-09-19  485  			hc->tx_p = tfrc_invert_loss_event_rate(opt_val);
536bb20b45dee3 Gerrit Renker            2010-09-19  486  
37efb03fbd0935 Gerrit Renker            2010-09-14  487  			ccid3_pr_debug("%s(%p), LOSS_EVENT_RATE=%u\n",
37efb03fbd0935 Gerrit Renker            2010-09-14  488  				       dccp_role(sk), sk, opt_val);
7c657876b63cb1 Arnaldo Carvalho de Melo 2005-08-09  489  		}
410e27a49bb98b Gerrit Renker            2008-09-09  490  	}
37efb03fbd0935 Gerrit Renker            2010-09-14  491  	return 0;
7c657876b63cb1 Arnaldo Carvalho de Melo 2005-08-09  492  }
7c657876b63cb1 Arnaldo Carvalho de Melo 2005-08-09  493  

:::::: The code at line 474 was first introduced by commit
:::::: 4874c131d79695e3d372042781a408a1a8a762d8 dccp: Add packet type information to CCID-specific option parsing

:::::: TO: Gerrit Renker <gerrit@xxxxxxxxxxxxxx>
:::::: CC: Gerrit Renker <gerrit@xxxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[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