All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Haowen Bai <baihaowen88@gmail.com>,
	sebastian.hesselbarth@gmail.com, davem@davemloft.net,
	kuba@kernel.org
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Haowen Bai <baihaowen88@gmail.com>
Subject: Re: [PATCH] net: marvell: Use min() instead of doing it manually
Date: Tue, 1 Mar 2022 18:29:29 +0800	[thread overview]
Message-ID: <202203011855.FRrOViok-lkp@intel.com> (raw)
In-Reply-To: <1646115417-24639-1-git-send-email-baihaowen88@gmail.com>

Hi Haowen,

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.17-rc6 next-20220228]
[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/Haowen-Bai/net-marvell-Use-min-instead-of-doing-it-manually/20220301-141800
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git f2b77012ddd5b2532d262f100be3394ceae3ea59
config: hexagon-randconfig-r041-20220301 (https://download.01.org/0day-ci/archive/20220301/202203011855.FRrOViok-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/55e43d9d6e3e0a8774e6a5e3976808e5736f6c9f
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Haowen-Bai/net-marvell-Use-min-instead-of-doing-it-manually/20220301-141800
        git checkout 55e43d9d6e3e0a8774e6a5e3976808e5736f6c9f
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/net/ethernet/marvell/

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

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/marvell/mv643xx_eth.c:1664:21: warning: comparison of distinct pointer types ('typeof (er->rx_pending) *' (aka 'unsigned int *') and 'typeof (4096) *' (aka 'int *')) [-Wcompare-distinct-pointer-types]
           mp->rx_ring_size = min(er->rx_pending, 4096);
                              ^~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:45:19: note: expanded from macro 'min'
   #define min(x, y)       __careful_cmp(x, y, <)
                           ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp'
           __builtin_choose_expr(__safe_cmp(x, y), \
                                 ^~~~~~~~~~~~~~~~
   include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp'
                   (__typecheck(x, y) && __no_side_effects(x, y))
                    ^~~~~~~~~~~~~~~~~
   include/linux/minmax.h:20:28: note: expanded from macro '__typecheck'
           (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
                      ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~
   1 warning generated.


vim +1664 drivers/net/ethernet/marvell/mv643xx_eth.c

  1653	
  1654	static int
  1655	mv643xx_eth_set_ringparam(struct net_device *dev, struct ethtool_ringparam *er,
  1656				  struct kernel_ethtool_ringparam *kernel_er,
  1657				  struct netlink_ext_ack *extack)
  1658	{
  1659		struct mv643xx_eth_private *mp = netdev_priv(dev);
  1660	
  1661		if (er->rx_mini_pending || er->rx_jumbo_pending)
  1662			return -EINVAL;
  1663	
> 1664		mp->rx_ring_size = min(er->rx_pending, 4096);
  1665		mp->tx_ring_size = clamp_t(unsigned int, er->tx_pending,
  1666					   MV643XX_MAX_SKB_DESCS * 2, 4096);
  1667		if (mp->tx_ring_size != er->tx_pending)
  1668			netdev_warn(dev, "TX queue size set to %u (requested %u)\n",
  1669				    mp->tx_ring_size, er->tx_pending);
  1670	
  1671		if (netif_running(dev)) {
  1672			mv643xx_eth_stop(dev);
  1673			if (mv643xx_eth_open(dev)) {
  1674				netdev_err(dev,
  1675					   "fatal error on re-opening device after ring param change\n");
  1676				return -ENOMEM;
  1677			}
  1678		}
  1679	
  1680		return 0;
  1681	}
  1682	

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

  parent reply	other threads:[~2022-03-01 10:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01  6:16 [PATCH] net: marvell: Use min() instead of doing it manually Haowen Bai
2022-03-01  7:33 ` Heiner Kallweit
2022-03-01 10:29 ` kernel test robot [this message]
2022-03-02  1:38   ` lotte bai
2022-03-02  1:38     ` lotte bai

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=202203011855.FRrOViok-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=baihaowen88@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kbuild-all@lists.01.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=sebastian.hesselbarth@gmail.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.