All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast
@ 2020-06-28 10:49 ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-06-28 10:49 UTC (permalink / raw)
  To: Luc Van Oostenryck; +Cc: kbuild-all, linux-kernel, Masahiro Yamada

[-- Attachment #1: Type: text/plain, Size: 6598 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   916a3b0fc1206f7e7ae8d00a21a3114b1dc67794
commit: 80591e61a0f7e88deaada69844e4a31280c4a38f kbuild: tell sparse about the $ARCH
date:   8 months ago
config: alpha-randconfig-s031-20200628 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-dirty
        git checkout 80591e61a0f7e88deaada69844e4a31280c4a38f
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=alpha CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

>> drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:978:48: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:1025:48: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:1025:48: sparse: sparse: non size-preserving pointer to integer cast

vim +1238 drivers/net/hamradio/dmascc.c

^1da177e4c3f41 Linus Torvalds    2005-04-16  1180  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1181  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1182  static void special_condition(struct scc_priv *priv, int rc)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1183  {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1184  	int cb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1185  	unsigned long flags;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1186  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1187  	/* See Figure 2-15. Only overrun and EOF need to be checked. */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1188  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1189  	if (rc & Rx_OVR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1190  		/* Receiver overrun */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1191  		priv->rx_over = 1;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1192  		if (priv->param.dma < 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1193  			write_scc(priv, R0, ERR_RES);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1194  	} else if (rc & END_FR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1195  		/* End of frame. Get byte count */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1196  		if (priv->param.dma >= 0) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1197  			flags = claim_dma_lock();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1198  			cb = BUF_SIZE - get_dma_residue(priv->param.dma) -
^1da177e4c3f41 Linus Torvalds    2005-04-16  1199  			    2;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1200  			release_dma_lock(flags);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1201  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1202  			cb = priv->rx_ptr - 2;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1203  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1204  		if (priv->rx_over) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1205  			/* We had an overrun */
13c0582d91ab63 Stephen Hemminger 2009-01-09  1206  			priv->dev->stats.rx_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1207  			if (priv->rx_over == 2)
13c0582d91ab63 Stephen Hemminger 2009-01-09  1208  				priv->dev->stats.rx_length_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1209  			else
13c0582d91ab63 Stephen Hemminger 2009-01-09  1210  				priv->dev->stats.rx_fifo_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1211  			priv->rx_over = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1212  		} else if (rc & CRC_ERR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1213  			/* Count invalid CRC only if packet length >= minimum */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1214  			if (cb >= 15) {
13c0582d91ab63 Stephen Hemminger 2009-01-09  1215  				priv->dev->stats.rx_errors++;
13c0582d91ab63 Stephen Hemminger 2009-01-09  1216  				priv->dev->stats.rx_crc_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1217  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1218  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1219  			if (cb >= 15) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1220  				if (priv->rx_count < NUM_RX_BUF - 1) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1221  					/* Put good frame in FIFO */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1222  					priv->rx_len[priv->rx_head] = cb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1223  					priv->rx_head =
^1da177e4c3f41 Linus Torvalds    2005-04-16  1224  					    (priv->rx_head +
^1da177e4c3f41 Linus Torvalds    2005-04-16  1225  					     1) % NUM_RX_BUF;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1226  					priv->rx_count++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1227  					schedule_work(&priv->rx_work);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1228  				} else {
13c0582d91ab63 Stephen Hemminger 2009-01-09  1229  					priv->dev->stats.rx_errors++;
13c0582d91ab63 Stephen Hemminger 2009-01-09  1230  					priv->dev->stats.rx_over_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1231  				}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1232  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1233  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1234  		/* Get ready for new frame */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1235  		if (priv->param.dma >= 0) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1236  			flags = claim_dma_lock();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1237  			set_dma_addr(priv->param.dma,
^1da177e4c3f41 Linus Torvalds    2005-04-16 @1238  				     (int) priv->rx_buf[priv->rx_head]);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1239  			set_dma_count(priv->param.dma, BUF_SIZE);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1240  			release_dma_lock(flags);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1241  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1242  			priv->rx_ptr = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1243  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1244  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1245  }
^1da177e4c3f41 Linus Torvalds    2005-04-16  1246  

:::::: The code at line 1238 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29640 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast
@ 2020-06-28 10:49 ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-06-28 10:49 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 6703 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   916a3b0fc1206f7e7ae8d00a21a3114b1dc67794
commit: 80591e61a0f7e88deaada69844e4a31280c4a38f kbuild: tell sparse about the $ARCH
date:   8 months ago
config: alpha-randconfig-s031-20200628 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-dirty
        git checkout 80591e61a0f7e88deaada69844e4a31280c4a38f
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=alpha CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

>> drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:978:48: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:1025:48: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:1025:48: sparse: sparse: non size-preserving pointer to integer cast

vim +1238 drivers/net/hamradio/dmascc.c

^1da177e4c3f41 Linus Torvalds    2005-04-16  1180  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1181  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1182  static void special_condition(struct scc_priv *priv, int rc)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1183  {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1184  	int cb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1185  	unsigned long flags;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1186  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1187  	/* See Figure 2-15. Only overrun and EOF need to be checked. */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1188  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1189  	if (rc & Rx_OVR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1190  		/* Receiver overrun */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1191  		priv->rx_over = 1;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1192  		if (priv->param.dma < 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1193  			write_scc(priv, R0, ERR_RES);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1194  	} else if (rc & END_FR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1195  		/* End of frame. Get byte count */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1196  		if (priv->param.dma >= 0) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1197  			flags = claim_dma_lock();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1198  			cb = BUF_SIZE - get_dma_residue(priv->param.dma) -
^1da177e4c3f41 Linus Torvalds    2005-04-16  1199  			    2;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1200  			release_dma_lock(flags);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1201  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1202  			cb = priv->rx_ptr - 2;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1203  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1204  		if (priv->rx_over) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1205  			/* We had an overrun */
13c0582d91ab63 Stephen Hemminger 2009-01-09  1206  			priv->dev->stats.rx_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1207  			if (priv->rx_over == 2)
13c0582d91ab63 Stephen Hemminger 2009-01-09  1208  				priv->dev->stats.rx_length_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1209  			else
13c0582d91ab63 Stephen Hemminger 2009-01-09  1210  				priv->dev->stats.rx_fifo_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1211  			priv->rx_over = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1212  		} else if (rc & CRC_ERR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1213  			/* Count invalid CRC only if packet length >= minimum */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1214  			if (cb >= 15) {
13c0582d91ab63 Stephen Hemminger 2009-01-09  1215  				priv->dev->stats.rx_errors++;
13c0582d91ab63 Stephen Hemminger 2009-01-09  1216  				priv->dev->stats.rx_crc_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1217  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1218  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1219  			if (cb >= 15) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1220  				if (priv->rx_count < NUM_RX_BUF - 1) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1221  					/* Put good frame in FIFO */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1222  					priv->rx_len[priv->rx_head] = cb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1223  					priv->rx_head =
^1da177e4c3f41 Linus Torvalds    2005-04-16  1224  					    (priv->rx_head +
^1da177e4c3f41 Linus Torvalds    2005-04-16  1225  					     1) % NUM_RX_BUF;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1226  					priv->rx_count++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1227  					schedule_work(&priv->rx_work);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1228  				} else {
13c0582d91ab63 Stephen Hemminger 2009-01-09  1229  					priv->dev->stats.rx_errors++;
13c0582d91ab63 Stephen Hemminger 2009-01-09  1230  					priv->dev->stats.rx_over_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1231  				}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1232  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1233  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1234  		/* Get ready for new frame */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1235  		if (priv->param.dma >= 0) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1236  			flags = claim_dma_lock();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1237  			set_dma_addr(priv->param.dma,
^1da177e4c3f41 Linus Torvalds    2005-04-16 @1238  				     (int) priv->rx_buf[priv->rx_head]);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1239  			set_dma_count(priv->param.dma, BUF_SIZE);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1240  			release_dma_lock(flags);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1241  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1242  			priv->rx_ptr = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1243  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1244  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1245  }
^1da177e4c3f41 Linus Torvalds    2005-04-16  1246  

:::::: The code at line 1238 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29640 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast
@ 2020-10-10 18:08 ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-10-10 18:08 UTC (permalink / raw)
  To: Luc Van Oostenryck; +Cc: kbuild-all, linux-kernel, Masahiro Yamada

[-- Attachment #1: Type: text/plain, Size: 7075 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   6f2f486d57c4d562cdf4932320b66fbb878ab1c4
commit: 80591e61a0f7e88deaada69844e4a31280c4a38f kbuild: tell sparse about the $ARCH
date:   11 months ago
config: alpha-randconfig-s031-20201011 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.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.2-229-g0c6896f4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=80591e61a0f7e88deaada69844e4a31280c4a38f
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 80591e61a0f7e88deaada69844e4a31280c4a38f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=alpha 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:978:48: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:1025:48: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:1025:48: sparse: sparse: non size-preserving pointer to integer cast

vim +1238 drivers/net/hamradio/dmascc.c

^1da177e4c3f41 Linus Torvalds    2005-04-16  1180  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1181  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1182  static void special_condition(struct scc_priv *priv, int rc)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1183  {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1184  	int cb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1185  	unsigned long flags;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1186  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1187  	/* See Figure 2-15. Only overrun and EOF need to be checked. */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1188  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1189  	if (rc & Rx_OVR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1190  		/* Receiver overrun */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1191  		priv->rx_over = 1;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1192  		if (priv->param.dma < 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1193  			write_scc(priv, R0, ERR_RES);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1194  	} else if (rc & END_FR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1195  		/* End of frame. Get byte count */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1196  		if (priv->param.dma >= 0) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1197  			flags = claim_dma_lock();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1198  			cb = BUF_SIZE - get_dma_residue(priv->param.dma) -
^1da177e4c3f41 Linus Torvalds    2005-04-16  1199  			    2;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1200  			release_dma_lock(flags);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1201  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1202  			cb = priv->rx_ptr - 2;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1203  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1204  		if (priv->rx_over) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1205  			/* We had an overrun */
13c0582d91ab63 Stephen Hemminger 2009-01-09  1206  			priv->dev->stats.rx_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1207  			if (priv->rx_over == 2)
13c0582d91ab63 Stephen Hemminger 2009-01-09  1208  				priv->dev->stats.rx_length_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1209  			else
13c0582d91ab63 Stephen Hemminger 2009-01-09  1210  				priv->dev->stats.rx_fifo_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1211  			priv->rx_over = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1212  		} else if (rc & CRC_ERR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1213  			/* Count invalid CRC only if packet length >= minimum */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1214  			if (cb >= 15) {
13c0582d91ab63 Stephen Hemminger 2009-01-09  1215  				priv->dev->stats.rx_errors++;
13c0582d91ab63 Stephen Hemminger 2009-01-09  1216  				priv->dev->stats.rx_crc_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1217  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1218  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1219  			if (cb >= 15) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1220  				if (priv->rx_count < NUM_RX_BUF - 1) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1221  					/* Put good frame in FIFO */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1222  					priv->rx_len[priv->rx_head] = cb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1223  					priv->rx_head =
^1da177e4c3f41 Linus Torvalds    2005-04-16  1224  					    (priv->rx_head +
^1da177e4c3f41 Linus Torvalds    2005-04-16  1225  					     1) % NUM_RX_BUF;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1226  					priv->rx_count++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1227  					schedule_work(&priv->rx_work);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1228  				} else {
13c0582d91ab63 Stephen Hemminger 2009-01-09  1229  					priv->dev->stats.rx_errors++;
13c0582d91ab63 Stephen Hemminger 2009-01-09  1230  					priv->dev->stats.rx_over_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1231  				}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1232  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1233  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1234  		/* Get ready for new frame */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1235  		if (priv->param.dma >= 0) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1236  			flags = claim_dma_lock();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1237  			set_dma_addr(priv->param.dma,
^1da177e4c3f41 Linus Torvalds    2005-04-16 @1238  				     (int) priv->rx_buf[priv->rx_head]);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1239  			set_dma_count(priv->param.dma, BUF_SIZE);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1240  			release_dma_lock(flags);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1241  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1242  			priv->rx_ptr = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1243  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1244  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1245  }
^1da177e4c3f41 Linus Torvalds    2005-04-16  1246  

:::::: The code at line 1238 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33478 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast
@ 2020-10-10 18:08 ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-10-10 18:08 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 7184 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   6f2f486d57c4d562cdf4932320b66fbb878ab1c4
commit: 80591e61a0f7e88deaada69844e4a31280c4a38f kbuild: tell sparse about the $ARCH
date:   11 months ago
config: alpha-randconfig-s031-20201011 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.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.2-229-g0c6896f4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=80591e61a0f7e88deaada69844e4a31280c4a38f
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 80591e61a0f7e88deaada69844e4a31280c4a38f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=alpha 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:978:48: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:1025:48: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:1025:48: sparse: sparse: non size-preserving pointer to integer cast

vim +1238 drivers/net/hamradio/dmascc.c

^1da177e4c3f41 Linus Torvalds    2005-04-16  1180  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1181  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1182  static void special_condition(struct scc_priv *priv, int rc)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1183  {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1184  	int cb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1185  	unsigned long flags;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1186  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1187  	/* See Figure 2-15. Only overrun and EOF need to be checked. */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1188  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1189  	if (rc & Rx_OVR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1190  		/* Receiver overrun */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1191  		priv->rx_over = 1;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1192  		if (priv->param.dma < 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1193  			write_scc(priv, R0, ERR_RES);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1194  	} else if (rc & END_FR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1195  		/* End of frame. Get byte count */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1196  		if (priv->param.dma >= 0) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1197  			flags = claim_dma_lock();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1198  			cb = BUF_SIZE - get_dma_residue(priv->param.dma) -
^1da177e4c3f41 Linus Torvalds    2005-04-16  1199  			    2;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1200  			release_dma_lock(flags);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1201  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1202  			cb = priv->rx_ptr - 2;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1203  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1204  		if (priv->rx_over) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1205  			/* We had an overrun */
13c0582d91ab63 Stephen Hemminger 2009-01-09  1206  			priv->dev->stats.rx_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1207  			if (priv->rx_over == 2)
13c0582d91ab63 Stephen Hemminger 2009-01-09  1208  				priv->dev->stats.rx_length_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1209  			else
13c0582d91ab63 Stephen Hemminger 2009-01-09  1210  				priv->dev->stats.rx_fifo_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1211  			priv->rx_over = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1212  		} else if (rc & CRC_ERR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1213  			/* Count invalid CRC only if packet length >= minimum */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1214  			if (cb >= 15) {
13c0582d91ab63 Stephen Hemminger 2009-01-09  1215  				priv->dev->stats.rx_errors++;
13c0582d91ab63 Stephen Hemminger 2009-01-09  1216  				priv->dev->stats.rx_crc_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1217  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1218  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1219  			if (cb >= 15) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1220  				if (priv->rx_count < NUM_RX_BUF - 1) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1221  					/* Put good frame in FIFO */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1222  					priv->rx_len[priv->rx_head] = cb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1223  					priv->rx_head =
^1da177e4c3f41 Linus Torvalds    2005-04-16  1224  					    (priv->rx_head +
^1da177e4c3f41 Linus Torvalds    2005-04-16  1225  					     1) % NUM_RX_BUF;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1226  					priv->rx_count++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1227  					schedule_work(&priv->rx_work);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1228  				} else {
13c0582d91ab63 Stephen Hemminger 2009-01-09  1229  					priv->dev->stats.rx_errors++;
13c0582d91ab63 Stephen Hemminger 2009-01-09  1230  					priv->dev->stats.rx_over_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1231  				}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1232  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1233  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1234  		/* Get ready for new frame */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1235  		if (priv->param.dma >= 0) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1236  			flags = claim_dma_lock();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1237  			set_dma_addr(priv->param.dma,
^1da177e4c3f41 Linus Torvalds    2005-04-16 @1238  				     (int) priv->rx_buf[priv->rx_head]);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1239  			set_dma_count(priv->param.dma, BUF_SIZE);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1240  			release_dma_lock(flags);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1241  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1242  			priv->rx_ptr = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1243  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1244  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1245  }
^1da177e4c3f41 Linus Torvalds    2005-04-16  1246  

:::::: The code at line 1238 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33478 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast
@ 2020-09-14  6:44 ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-09-14  6:44 UTC (permalink / raw)
  To: Luc Van Oostenryck; +Cc: kbuild-all, linux-kernel, Masahiro Yamada

[-- Attachment #1: Type: text/plain, Size: 7104 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   856deb866d16e29bd65952e0289066f6078af773
commit: 80591e61a0f7e88deaada69844e4a31280c4a38f kbuild: tell sparse about the $ARCH
date:   10 months ago
config: alpha-randconfig-s031-20200914 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.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.2-191-g10164920-dirty
        git checkout 80591e61a0f7e88deaada69844e4a31280c4a38f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=alpha 

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


sparse warnings: (new ones prefixed by >>)

>> drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:978:48: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:1025:48: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:1025:48: sparse: sparse: non size-preserving pointer to integer cast

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=80591e61a0f7e88deaada69844e4a31280c4a38f
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 80591e61a0f7e88deaada69844e4a31280c4a38f
vim +1238 drivers/net/hamradio/dmascc.c

^1da177e4c3f41 Linus Torvalds    2005-04-16  1180  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1181  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1182  static void special_condition(struct scc_priv *priv, int rc)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1183  {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1184  	int cb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1185  	unsigned long flags;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1186  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1187  	/* See Figure 2-15. Only overrun and EOF need to be checked. */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1188  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1189  	if (rc & Rx_OVR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1190  		/* Receiver overrun */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1191  		priv->rx_over = 1;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1192  		if (priv->param.dma < 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1193  			write_scc(priv, R0, ERR_RES);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1194  	} else if (rc & END_FR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1195  		/* End of frame. Get byte count */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1196  		if (priv->param.dma >= 0) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1197  			flags = claim_dma_lock();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1198  			cb = BUF_SIZE - get_dma_residue(priv->param.dma) -
^1da177e4c3f41 Linus Torvalds    2005-04-16  1199  			    2;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1200  			release_dma_lock(flags);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1201  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1202  			cb = priv->rx_ptr - 2;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1203  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1204  		if (priv->rx_over) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1205  			/* We had an overrun */
13c0582d91ab63 Stephen Hemminger 2009-01-09  1206  			priv->dev->stats.rx_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1207  			if (priv->rx_over == 2)
13c0582d91ab63 Stephen Hemminger 2009-01-09  1208  				priv->dev->stats.rx_length_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1209  			else
13c0582d91ab63 Stephen Hemminger 2009-01-09  1210  				priv->dev->stats.rx_fifo_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1211  			priv->rx_over = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1212  		} else if (rc & CRC_ERR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1213  			/* Count invalid CRC only if packet length >= minimum */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1214  			if (cb >= 15) {
13c0582d91ab63 Stephen Hemminger 2009-01-09  1215  				priv->dev->stats.rx_errors++;
13c0582d91ab63 Stephen Hemminger 2009-01-09  1216  				priv->dev->stats.rx_crc_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1217  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1218  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1219  			if (cb >= 15) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1220  				if (priv->rx_count < NUM_RX_BUF - 1) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1221  					/* Put good frame in FIFO */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1222  					priv->rx_len[priv->rx_head] = cb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1223  					priv->rx_head =
^1da177e4c3f41 Linus Torvalds    2005-04-16  1224  					    (priv->rx_head +
^1da177e4c3f41 Linus Torvalds    2005-04-16  1225  					     1) % NUM_RX_BUF;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1226  					priv->rx_count++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1227  					schedule_work(&priv->rx_work);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1228  				} else {
13c0582d91ab63 Stephen Hemminger 2009-01-09  1229  					priv->dev->stats.rx_errors++;
13c0582d91ab63 Stephen Hemminger 2009-01-09  1230  					priv->dev->stats.rx_over_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1231  				}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1232  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1233  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1234  		/* Get ready for new frame */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1235  		if (priv->param.dma >= 0) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1236  			flags = claim_dma_lock();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1237  			set_dma_addr(priv->param.dma,
^1da177e4c3f41 Linus Torvalds    2005-04-16 @1238  				     (int) priv->rx_buf[priv->rx_head]);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1239  			set_dma_count(priv->param.dma, BUF_SIZE);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1240  			release_dma_lock(flags);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1241  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1242  			priv->rx_ptr = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1243  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1244  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1245  }
^1da177e4c3f41 Linus Torvalds    2005-04-16  1246  

:::::: The code at line 1238 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 19656 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast
@ 2020-09-14  6:44 ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-09-14  6:44 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 7215 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   856deb866d16e29bd65952e0289066f6078af773
commit: 80591e61a0f7e88deaada69844e4a31280c4a38f kbuild: tell sparse about the $ARCH
date:   10 months ago
config: alpha-randconfig-s031-20200914 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.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.2-191-g10164920-dirty
        git checkout 80591e61a0f7e88deaada69844e4a31280c4a38f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=alpha 

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


sparse warnings: (new ones prefixed by >>)

>> drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:978:48: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:1025:48: sparse: sparse: non size-preserving pointer to integer cast
   drivers/net/hamradio/dmascc.c:1025:48: sparse: sparse: non size-preserving pointer to integer cast

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=80591e61a0f7e88deaada69844e4a31280c4a38f
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 80591e61a0f7e88deaada69844e4a31280c4a38f
vim +1238 drivers/net/hamradio/dmascc.c

^1da177e4c3f41 Linus Torvalds    2005-04-16  1180  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1181  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1182  static void special_condition(struct scc_priv *priv, int rc)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1183  {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1184  	int cb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1185  	unsigned long flags;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1186  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1187  	/* See Figure 2-15. Only overrun and EOF need to be checked. */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1188  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1189  	if (rc & Rx_OVR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1190  		/* Receiver overrun */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1191  		priv->rx_over = 1;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1192  		if (priv->param.dma < 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1193  			write_scc(priv, R0, ERR_RES);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1194  	} else if (rc & END_FR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1195  		/* End of frame. Get byte count */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1196  		if (priv->param.dma >= 0) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1197  			flags = claim_dma_lock();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1198  			cb = BUF_SIZE - get_dma_residue(priv->param.dma) -
^1da177e4c3f41 Linus Torvalds    2005-04-16  1199  			    2;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1200  			release_dma_lock(flags);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1201  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1202  			cb = priv->rx_ptr - 2;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1203  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1204  		if (priv->rx_over) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1205  			/* We had an overrun */
13c0582d91ab63 Stephen Hemminger 2009-01-09  1206  			priv->dev->stats.rx_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1207  			if (priv->rx_over == 2)
13c0582d91ab63 Stephen Hemminger 2009-01-09  1208  				priv->dev->stats.rx_length_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1209  			else
13c0582d91ab63 Stephen Hemminger 2009-01-09  1210  				priv->dev->stats.rx_fifo_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1211  			priv->rx_over = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1212  		} else if (rc & CRC_ERR) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1213  			/* Count invalid CRC only if packet length >= minimum */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1214  			if (cb >= 15) {
13c0582d91ab63 Stephen Hemminger 2009-01-09  1215  				priv->dev->stats.rx_errors++;
13c0582d91ab63 Stephen Hemminger 2009-01-09  1216  				priv->dev->stats.rx_crc_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1217  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1218  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1219  			if (cb >= 15) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1220  				if (priv->rx_count < NUM_RX_BUF - 1) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1221  					/* Put good frame in FIFO */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1222  					priv->rx_len[priv->rx_head] = cb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1223  					priv->rx_head =
^1da177e4c3f41 Linus Torvalds    2005-04-16  1224  					    (priv->rx_head +
^1da177e4c3f41 Linus Torvalds    2005-04-16  1225  					     1) % NUM_RX_BUF;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1226  					priv->rx_count++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1227  					schedule_work(&priv->rx_work);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1228  				} else {
13c0582d91ab63 Stephen Hemminger 2009-01-09  1229  					priv->dev->stats.rx_errors++;
13c0582d91ab63 Stephen Hemminger 2009-01-09  1230  					priv->dev->stats.rx_over_errors++;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1231  				}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1232  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1233  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1234  		/* Get ready for new frame */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1235  		if (priv->param.dma >= 0) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1236  			flags = claim_dma_lock();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1237  			set_dma_addr(priv->param.dma,
^1da177e4c3f41 Linus Torvalds    2005-04-16 @1238  				     (int) priv->rx_buf[priv->rx_head]);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1239  			set_dma_count(priv->param.dma, BUF_SIZE);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1240  			release_dma_lock(flags);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1241  		} else {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1242  			priv->rx_ptr = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1243  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1244  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1245  }
^1da177e4c3f41 Linus Torvalds    2005-04-16  1246  

:::::: The code at line 1238 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 19656 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-10 22:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-28 10:49 drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast kernel test robot
2020-06-28 10:49 ` kernel test robot
2020-09-14  6:44 kernel test robot
2020-09-14  6:44 ` kernel test robot
2020-10-10 18:08 kernel test robot
2020-10-10 18:08 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.