All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Masahiro Yamada <yamada.masahiro@socionext.com>
Subject: drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast
Date: Sun, 11 Oct 2020 02:08:13 +0800	[thread overview]
Message-ID: <202010110206.3iqpx79L-lkp@intel.com> (raw)

[-- 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 --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast
Date: Sun, 11 Oct 2020 02:08:13 +0800	[thread overview]
Message-ID: <202010110206.3iqpx79L-lkp@intel.com> (raw)

[-- 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 --]

             reply	other threads:[~2020-10-10 22:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-10 18:08 kernel test robot [this message]
2020-10-10 18:08 ` drivers/net/hamradio/dmascc.c:1238:56: sparse: sparse: non size-preserving pointer to integer cast kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2020-09-14  6:44 kernel test robot
2020-09-14  6:44 ` kernel test robot
2020-06-28 10:49 kernel test robot
2020-06-28 10:49 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202010110206.3iqpx79L-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.