LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ong Boon Leong <boon.leong.ong@intel.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1647 init_dma_rx_desc_rings() warn: always true condition '(queue >= 0) => (0-u32max >= 0)'
Date: Tue, 3 Aug 2021 14:33:26 +0800	[thread overview]
Message-ID: <202108031419.LhkynJjt-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c500bee1c5b2f1d59b1081ac879d73268ab0ff17
commit: de0b90e52a116a951ca8b13c924c359d5fc39fa0 net: stmmac: rearrange RX and TX desc init into per-queue basis
date:   4 months ago
config: openrisc-randconfig-m031-20210803 (attached as .config)
compiler: or1k-linux-gcc (GCC) 10.3.0

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

New smatch warnings:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1647 init_dma_rx_desc_rings() warn: always true condition '(queue >= 0) => (0-u32max >= 0)'
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1647 init_dma_rx_desc_rings() warn: always true condition '(queue >= 0) => (0-u32max >= 0)'

Old smatch warnings:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1567 stmmac_reinit_rx_buffers() warn: always true condition '(queue >= 0) => (0-u32max >= 0)'
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1567 stmmac_reinit_rx_buffers() warn: always true condition '(queue >= 0) => (0-u32max >= 0)'
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:4453 stmmac_xdp_run_prog() error: (-2147483647) too low for ERR_PTR

vim +1647 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

de0b90e52a116a Ong Boon Leong 2021-04-13  1626  
de0b90e52a116a Ong Boon Leong 2021-04-13  1627  static int init_dma_rx_desc_rings(struct net_device *dev, gfp_t flags)
de0b90e52a116a Ong Boon Leong 2021-04-13  1628  {
de0b90e52a116a Ong Boon Leong 2021-04-13  1629  	struct stmmac_priv *priv = netdev_priv(dev);
de0b90e52a116a Ong Boon Leong 2021-04-13  1630  	u32 rx_count = priv->plat->rx_queues_to_use;
de0b90e52a116a Ong Boon Leong 2021-04-13  1631  	u32 queue;
de0b90e52a116a Ong Boon Leong 2021-04-13  1632  	int ret;
de0b90e52a116a Ong Boon Leong 2021-04-13  1633  
de0b90e52a116a Ong Boon Leong 2021-04-13  1634  	/* RX INITIALIZATION */
de0b90e52a116a Ong Boon Leong 2021-04-13  1635  	netif_dbg(priv, probe, priv->dev,
de0b90e52a116a Ong Boon Leong 2021-04-13  1636  		  "SKB addresses:\nskb\t\tskb data\tdma data\n");
de0b90e52a116a Ong Boon Leong 2021-04-13  1637  
de0b90e52a116a Ong Boon Leong 2021-04-13  1638  	for (queue = 0; queue < rx_count; queue++) {
de0b90e52a116a Ong Boon Leong 2021-04-13  1639  		ret = __init_dma_rx_desc_rings(priv, queue, flags);
de0b90e52a116a Ong Boon Leong 2021-04-13  1640  		if (ret)
de0b90e52a116a Ong Boon Leong 2021-04-13  1641  			goto err_init_rx_buffers;
54139cf3bb33fa Joao Pinto     2017-04-06  1642  	}
54139cf3bb33fa Joao Pinto     2017-04-06  1643  
71fedb0198cbbd Joao Pinto     2017-04-06  1644  	return 0;
54139cf3bb33fa Joao Pinto     2017-04-06  1645  
71fedb0198cbbd Joao Pinto     2017-04-06  1646  err_init_rx_buffers:
54139cf3bb33fa Joao Pinto     2017-04-06 @1647  	while (queue >= 0) {
4298255f26fa91 Ong Boon Leong 2021-04-13  1648  		dma_free_rx_skbufs(priv, queue);
54139cf3bb33fa Joao Pinto     2017-04-06  1649  
54139cf3bb33fa Joao Pinto     2017-04-06  1650  		if (queue == 0)
54139cf3bb33fa Joao Pinto     2017-04-06  1651  			break;
54139cf3bb33fa Joao Pinto     2017-04-06  1652  
54139cf3bb33fa Joao Pinto     2017-04-06  1653  		queue--;
54139cf3bb33fa Joao Pinto     2017-04-06  1654  	}
54139cf3bb33fa Joao Pinto     2017-04-06  1655  
71fedb0198cbbd Joao Pinto     2017-04-06  1656  	return ret;
71fedb0198cbbd Joao Pinto     2017-04-06  1657  }
71fedb0198cbbd Joao Pinto     2017-04-06  1658  

:::::: The code at line 1647 was first introduced by commit
:::::: 54139cf3bb33fad075737000f22749cafe3e83a0 net: stmmac: adding multiple buffers for rx

:::::: TO: Joao Pinto <Joao.Pinto@synopsys.com>
:::::: CC: David S. Miller <davem@davemloft.net>

---
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: 34458 bytes --]

             reply	other threads:[~2021-08-03  6:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03  6:33 kernel test robot [this message]
2021-11-18 22:57 kernel test robot
2021-11-22 20:01 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=202108031419.LhkynJjt-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=boon.leong.ong@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1647 init_dma_rx_desc_rings() warn: always true condition '\''(queue >= 0) => (0-u32max >= 0)'\''' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).