public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: cgel.zte@gmail.com, thomas.petazzoni@bootlin.com
Cc: kbuild-all@lists.01.org, davem@davemloft.net, kuba@kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Changcheng Deng <deng.changcheng@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] net: mvneta: use min() to make code cleaner
Date: Thu, 23 Dec 2021 10:54:34 +0800	[thread overview]
Message-ID: <202112231021.c93ilPDO-lkp@intel.com> (raw)
In-Reply-To: <20211220113648.473204-1-deng.changcheng@zte.com.cn>

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]
[also build test WARNING on net/master horms-ipvs/master linus/master v5.16-rc6 next-20211222]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/cgel-zte-gmail-com/net-mvneta-use-min-to-make-code-cleaner/20211220-193846
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 434ed21389948a45c238f63258bd5aae4237e20b
config: sh-randconfig-s032-20211222 (https://download.01.org/0day-ci/archive/20211223/202112231021.c93ilPDO-lkp@intel.com/config)
compiler: sh4-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://github.com/0day-ci/linux/commit/be0462f87c94afd5304c286f4b7041e92f5df0bd
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review cgel-zte-gmail-com/net-mvneta-use-min-to-make-code-cleaner/20211220-193846
        git checkout be0462f87c94afd5304c286f4b7041e92f5df0bd
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sh SHELL=/bin/bash

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/ethernet/marvell/mvneta.c:1787:25: sparse: sparse: restricted __be16 degrades to integer
   drivers/net/ethernet/marvell/mvneta.c:1969:45: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected int l3_proto @@     got restricted __be16 [usertype] l3_proto @@
   drivers/net/ethernet/marvell/mvneta.c:1969:45: sparse:     expected int l3_proto
   drivers/net/ethernet/marvell/mvneta.c:1969:45: sparse:     got restricted __be16 [usertype] l3_proto
>> drivers/net/ethernet/marvell/mvneta.c:4637:28: sparse: sparse: incompatible types in comparison expression (different signedness):
>> drivers/net/ethernet/marvell/mvneta.c:4637:28: sparse:    unsigned int *
>> drivers/net/ethernet/marvell/mvneta.c:4637:28: sparse:    int *

vim +4637 drivers/net/ethernet/marvell/mvneta.c

  4626	
  4627	static int
  4628	mvneta_ethtool_set_ringparam(struct net_device *dev,
  4629				     struct ethtool_ringparam *ring,
  4630				     struct kernel_ethtool_ringparam *kernel_ring,
  4631				     struct netlink_ext_ack *extack)
  4632	{
  4633		struct mvneta_port *pp = netdev_priv(dev);
  4634	
  4635		if ((ring->rx_pending == 0) || (ring->tx_pending == 0))
  4636			return -EINVAL;
> 4637		pp->rx_ring_size = min(ring->rx_pending, MVNETA_MAX_RXD);
  4638	
  4639		pp->tx_ring_size = clamp_t(u16, ring->tx_pending,
  4640					   MVNETA_MAX_SKB_DESCS * 2, MVNETA_MAX_TXD);
  4641		if (pp->tx_ring_size != ring->tx_pending)
  4642			netdev_warn(dev, "TX queue size set to %u (requested %u)\n",
  4643				    pp->tx_ring_size, ring->tx_pending);
  4644	
  4645		if (netif_running(dev)) {
  4646			mvneta_stop(dev);
  4647			if (mvneta_open(dev)) {
  4648				netdev_err(dev,
  4649					   "error on opening device after ring param change\n");
  4650				return -ENOMEM;
  4651			}
  4652		}
  4653	
  4654		return 0;
  4655	}
  4656	

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

      reply	other threads:[~2021-12-23  2:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 11:36 [PATCH] net: mvneta: use min() to make code cleaner cgel.zte
2021-12-23  2:54 ` kernel test robot [this message]

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=202112231021.c93ilPDO-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cgel.zte@gmail.com \
    --cc=davem@davemloft.net \
    --cc=deng.changcheng@zte.com.cn \
    --cc=kbuild-all@lists.01.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=zealci@zte.com.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox