All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1647 init_dma_rx_desc_rings() warn: always true condition '(queue >= 0) => (0-u32max >= 0)'
@ 2021-08-03  6:33 ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-08-03  6:33 UTC (permalink / raw)
  To: Ong Boon Leong; +Cc: kbuild-all, linux-kernel

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

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

* drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1647 init_dma_rx_desc_rings() warn: always true condition '(queue >= 0) => (0-u32max >= 0)'
@ 2021-08-03  6:33 ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-08-03  6:33 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3885 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(a)lists.01.org

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

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

* drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1647 init_dma_rx_desc_rings() warn: always true condition '(queue >= 0) => (0-u32max >= 0)'
@ 2021-11-22 20:01 ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-11-22 20:01 UTC (permalink / raw)
  To: Ong Boon Leong; +Cc: kbuild-all, linux-kernel

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   136057256686de39cc3a07c2e39ef6bc43003ff6
commit: de0b90e52a116a951ca8b13c924c359d5fc39fa0 net: stmmac: rearrange RX and TX desc init into per-queue basis
date:   7 months ago
config: x86_64-randconfig-m031-20211117 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.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: 36343 bytes --]

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

* drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1647 init_dma_rx_desc_rings() warn: always true condition '(queue >= 0) => (0-u32max >= 0)'
@ 2021-11-22 20:01 ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-11-22 20:01 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   136057256686de39cc3a07c2e39ef6bc43003ff6
commit: de0b90e52a116a951ca8b13c924c359d5fc39fa0 net: stmmac: rearrange RX and TX desc init into per-queue basis
date:   7 months ago
config: x86_64-randconfig-m031-20211117 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.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(a)lists.01.org

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

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

* drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1647 init_dma_rx_desc_rings() warn: always true condition '(queue >= 0) => (0-u32max >= 0)'
@ 2021-11-18 22:57 ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-11-18 22:57 UTC (permalink / raw)
  To: Ong Boon Leong; +Cc: kbuild-all, linux-kernel

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   6fdf886424cf8c4fff96a20189c00606327e5df6
commit: de0b90e52a116a951ca8b13c924c359d5fc39fa0 net: stmmac: rearrange RX and TX desc init into per-queue basis
date:   7 months ago
config: arm-randconfig-m031-20211116 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.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

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

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

* drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1647 init_dma_rx_desc_rings() warn: always true condition '(queue >= 0) => (0-u32max >= 0)'
@ 2021-11-18 22:57 ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-11-18 22:57 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   6fdf886424cf8c4fff96a20189c00606327e5df6
commit: de0b90e52a116a951ca8b13c924c359d5fc39fa0 net: stmmac: rearrange RX and TX desc init into per-queue basis
date:   7 months ago
config: arm-randconfig-m031-20211116 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.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

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

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

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

end of thread, other threads:[~2021-11-22 20:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03  6:33 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1647 init_dma_rx_desc_rings() warn: always true condition '(queue >= 0) => (0-u32max >= 0)' kernel test robot
2021-08-03  6:33 ` kernel test robot
2021-11-18 22:57 kernel test robot
2021-11-18 22:57 ` kernel test robot
2021-11-22 20:01 kernel test robot
2021-11-22 20:01 ` 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.