All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Emil Tantilov <emil.s.tantilov@intel.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Intel Wired LAN <intel-wired-lan@lists.osuosl.org>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
	Chittim Madhu <madhu.chittim@intel.com>
Subject: [Intel-wired-lan] [tnguy-net-queue:dev-queue 7/17] drivers/net/ethernet/intel/idpf/idpf_ethtool.c:1713:10: warning: comparison of array 'np->state' not equal to a null pointer is always true
Date: Sat, 4 Oct 2025 16:09:32 +0800	[thread overview]
Message-ID: <202510041605.cSnfIA5l-lkp@intel.com> (raw)

Hi Emil,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue.git dev-queue
head:   e50b34f0f3fb86c9be2f9ad3b7ed483f18b46896
commit: 7c0e8a950dbd30ca46e999cf1d25f3e97a98f174 [7/17] idpf: convert vport state to bitmap
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20251004/202510041605.cSnfIA5l-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 39f292ffa13d7ca0d1edff27ac8fd55024bb4d19)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251004/202510041605.cSnfIA5l-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510041605.cSnfIA5l-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/intel/idpf/idpf_ethtool.c:1713:19: error: use of undeclared identifier '__IDPF_VPORT_UP'; did you mean 'IDPF_VPORT_UP'?
    1713 |         if (np->state != __IDPF_VPORT_UP)
         |                          ^~~~~~~~~~~~~~~
         |                          IDPF_VPORT_UP
   drivers/net/ethernet/intel/idpf/idpf.h:138:2: note: 'IDPF_VPORT_UP' declared here
     138 |         IDPF_VPORT_UP,
         |         ^
>> drivers/net/ethernet/intel/idpf/idpf_ethtool.c:1713:10: warning: comparison of array 'np->state' not equal to a null pointer is always true [-Wtautological-pointer-compare]
    1713 |         if (np->state != __IDPF_VPORT_UP)
         |             ~~~~^~~~~    ~~~~~~~~~~~~~~~
   1 warning and 1 error generated.
--
   drivers/net/ethernet/intel/idpf/xdp.c:421:20: error: use of undeclared identifier '__IDPF_VPORT_UP'; did you mean 'IDPF_VPORT_UP'?
     421 |                 if (np->state == __IDPF_VPORT_UP)
         |                                  ^~~~~~~~~~~~~~~
         |                                  IDPF_VPORT_UP
   drivers/net/ethernet/intel/idpf/idpf.h:138:2: note: 'IDPF_VPORT_UP' declared here
     138 |         IDPF_VPORT_UP,
         |         ^
>> drivers/net/ethernet/intel/idpf/xdp.c:421:11: warning: comparison of array 'np->state' equal to a null pointer is always false [-Wtautological-pointer-compare]
     421 |                 if (np->state == __IDPF_VPORT_UP)
         |                     ~~~~^~~~~    ~~~~~~~~~~~~~~~
   1 warning and 1 error generated.


vim +1713 drivers/net/ethernet/intel/idpf/idpf_ethtool.c

1a49cf814fe1ed Milena Olech 2025-04-16  1687  
7a5a03869801e2 Milena Olech 2025-08-29  1688  /**
7a5a03869801e2 Milena Olech 2025-08-29  1689   * idpf_get_ts_stats - Collect HW tstamping statistics
7a5a03869801e2 Milena Olech 2025-08-29  1690   * @netdev: network interface device structure
7a5a03869801e2 Milena Olech 2025-08-29  1691   * @ts_stats: HW timestamping stats structure
7a5a03869801e2 Milena Olech 2025-08-29  1692   *
7a5a03869801e2 Milena Olech 2025-08-29  1693   * Collect HW timestamping statistics including successfully timestamped
7a5a03869801e2 Milena Olech 2025-08-29  1694   * packets, discarded due to illegal values, flushed during releasing PTP and
7a5a03869801e2 Milena Olech 2025-08-29  1695   * skipped due to lack of the free index.
7a5a03869801e2 Milena Olech 2025-08-29  1696   */
7a5a03869801e2 Milena Olech 2025-08-29  1697  static void idpf_get_ts_stats(struct net_device *netdev,
7a5a03869801e2 Milena Olech 2025-08-29  1698  			      struct ethtool_ts_stats *ts_stats)
7a5a03869801e2 Milena Olech 2025-08-29  1699  {
7a5a03869801e2 Milena Olech 2025-08-29  1700  	struct idpf_netdev_priv *np = netdev_priv(netdev);
7a5a03869801e2 Milena Olech 2025-08-29  1701  	struct idpf_vport *vport;
7a5a03869801e2 Milena Olech 2025-08-29  1702  	unsigned int start;
7a5a03869801e2 Milena Olech 2025-08-29  1703  
7a5a03869801e2 Milena Olech 2025-08-29  1704  	idpf_vport_ctrl_lock(netdev);
7a5a03869801e2 Milena Olech 2025-08-29  1705  	vport = idpf_netdev_to_vport(netdev);
7a5a03869801e2 Milena Olech 2025-08-29  1706  	do {
7a5a03869801e2 Milena Olech 2025-08-29  1707  		start = u64_stats_fetch_begin(&vport->tstamp_stats.stats_sync);
7a5a03869801e2 Milena Olech 2025-08-29  1708  		ts_stats->pkts = u64_stats_read(&vport->tstamp_stats.packets);
7a5a03869801e2 Milena Olech 2025-08-29  1709  		ts_stats->lost = u64_stats_read(&vport->tstamp_stats.flushed);
7a5a03869801e2 Milena Olech 2025-08-29  1710  		ts_stats->err = u64_stats_read(&vport->tstamp_stats.discarded);
7a5a03869801e2 Milena Olech 2025-08-29  1711  	} while (u64_stats_fetch_retry(&vport->tstamp_stats.stats_sync, start));
7a5a03869801e2 Milena Olech 2025-08-29  1712  
7a5a03869801e2 Milena Olech 2025-08-29 @1713  	if (np->state != __IDPF_VPORT_UP)
7a5a03869801e2 Milena Olech 2025-08-29  1714  		goto exit;
7a5a03869801e2 Milena Olech 2025-08-29  1715  
7a5a03869801e2 Milena Olech 2025-08-29  1716  	for (u16 i = 0; i < vport->num_txq_grp; i++) {
7a5a03869801e2 Milena Olech 2025-08-29  1717  		struct idpf_txq_group *txq_grp = &vport->txq_grps[i];
7a5a03869801e2 Milena Olech 2025-08-29  1718  
7a5a03869801e2 Milena Olech 2025-08-29  1719  		for (u16 j = 0; j < txq_grp->num_txq; j++) {
7a5a03869801e2 Milena Olech 2025-08-29  1720  			struct idpf_tx_queue *txq = txq_grp->txqs[j];
7a5a03869801e2 Milena Olech 2025-08-29  1721  			struct idpf_tx_queue_stats *stats;
7a5a03869801e2 Milena Olech 2025-08-29  1722  			u64 ts;
7a5a03869801e2 Milena Olech 2025-08-29  1723  
7a5a03869801e2 Milena Olech 2025-08-29  1724  			if (!txq)
7a5a03869801e2 Milena Olech 2025-08-29  1725  				continue;
7a5a03869801e2 Milena Olech 2025-08-29  1726  
7a5a03869801e2 Milena Olech 2025-08-29  1727  			stats = &txq->q_stats;
7a5a03869801e2 Milena Olech 2025-08-29  1728  			do {
7a5a03869801e2 Milena Olech 2025-08-29  1729  				start = u64_stats_fetch_begin(&txq->stats_sync);
7a5a03869801e2 Milena Olech 2025-08-29  1730  
7a5a03869801e2 Milena Olech 2025-08-29  1731  				ts = u64_stats_read(&stats->tstamp_skipped);
7a5a03869801e2 Milena Olech 2025-08-29  1732  			} while (u64_stats_fetch_retry(&txq->stats_sync,
7a5a03869801e2 Milena Olech 2025-08-29  1733  						       start));
7a5a03869801e2 Milena Olech 2025-08-29  1734  
7a5a03869801e2 Milena Olech 2025-08-29  1735  			ts_stats->lost += ts;
7a5a03869801e2 Milena Olech 2025-08-29  1736  		}
7a5a03869801e2 Milena Olech 2025-08-29  1737  	}
7a5a03869801e2 Milena Olech 2025-08-29  1738  
7a5a03869801e2 Milena Olech 2025-08-29  1739  exit:
7a5a03869801e2 Milena Olech 2025-08-29  1740  	idpf_vport_ctrl_unlock(netdev);
7a5a03869801e2 Milena Olech 2025-08-29  1741  }
7a5a03869801e2 Milena Olech 2025-08-29  1742  

:::::: The code at line 1713 was first introduced by commit
:::::: 7a5a03869801e2f1cabdc55b2e697fea20da5c68 idpf: add HW timestamping statistics

:::::: TO: Milena Olech <milena.olech@intel.com>
:::::: CC: Tony Nguyen <anthony.l.nguyen@intel.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Emil Tantilov <emil.s.tantilov@intel.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Intel Wired LAN <intel-wired-lan@lists.osuosl.org>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
	Chittim Madhu <madhu.chittim@intel.com>
Subject: [tnguy-net-queue:dev-queue 7/17] drivers/net/ethernet/intel/idpf/idpf_ethtool.c:1713:10: warning: comparison of array 'np->state' not equal to a null pointer is always true
Date: Sat, 4 Oct 2025 16:09:32 +0800	[thread overview]
Message-ID: <202510041605.cSnfIA5l-lkp@intel.com> (raw)

Hi Emil,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue.git dev-queue
head:   e50b34f0f3fb86c9be2f9ad3b7ed483f18b46896
commit: 7c0e8a950dbd30ca46e999cf1d25f3e97a98f174 [7/17] idpf: convert vport state to bitmap
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20251004/202510041605.cSnfIA5l-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 39f292ffa13d7ca0d1edff27ac8fd55024bb4d19)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251004/202510041605.cSnfIA5l-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510041605.cSnfIA5l-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/intel/idpf/idpf_ethtool.c:1713:19: error: use of undeclared identifier '__IDPF_VPORT_UP'; did you mean 'IDPF_VPORT_UP'?
    1713 |         if (np->state != __IDPF_VPORT_UP)
         |                          ^~~~~~~~~~~~~~~
         |                          IDPF_VPORT_UP
   drivers/net/ethernet/intel/idpf/idpf.h:138:2: note: 'IDPF_VPORT_UP' declared here
     138 |         IDPF_VPORT_UP,
         |         ^
>> drivers/net/ethernet/intel/idpf/idpf_ethtool.c:1713:10: warning: comparison of array 'np->state' not equal to a null pointer is always true [-Wtautological-pointer-compare]
    1713 |         if (np->state != __IDPF_VPORT_UP)
         |             ~~~~^~~~~    ~~~~~~~~~~~~~~~
   1 warning and 1 error generated.
--
   drivers/net/ethernet/intel/idpf/xdp.c:421:20: error: use of undeclared identifier '__IDPF_VPORT_UP'; did you mean 'IDPF_VPORT_UP'?
     421 |                 if (np->state == __IDPF_VPORT_UP)
         |                                  ^~~~~~~~~~~~~~~
         |                                  IDPF_VPORT_UP
   drivers/net/ethernet/intel/idpf/idpf.h:138:2: note: 'IDPF_VPORT_UP' declared here
     138 |         IDPF_VPORT_UP,
         |         ^
>> drivers/net/ethernet/intel/idpf/xdp.c:421:11: warning: comparison of array 'np->state' equal to a null pointer is always false [-Wtautological-pointer-compare]
     421 |                 if (np->state == __IDPF_VPORT_UP)
         |                     ~~~~^~~~~    ~~~~~~~~~~~~~~~
   1 warning and 1 error generated.


vim +1713 drivers/net/ethernet/intel/idpf/idpf_ethtool.c

1a49cf814fe1ed Milena Olech 2025-04-16  1687  
7a5a03869801e2 Milena Olech 2025-08-29  1688  /**
7a5a03869801e2 Milena Olech 2025-08-29  1689   * idpf_get_ts_stats - Collect HW tstamping statistics
7a5a03869801e2 Milena Olech 2025-08-29  1690   * @netdev: network interface device structure
7a5a03869801e2 Milena Olech 2025-08-29  1691   * @ts_stats: HW timestamping stats structure
7a5a03869801e2 Milena Olech 2025-08-29  1692   *
7a5a03869801e2 Milena Olech 2025-08-29  1693   * Collect HW timestamping statistics including successfully timestamped
7a5a03869801e2 Milena Olech 2025-08-29  1694   * packets, discarded due to illegal values, flushed during releasing PTP and
7a5a03869801e2 Milena Olech 2025-08-29  1695   * skipped due to lack of the free index.
7a5a03869801e2 Milena Olech 2025-08-29  1696   */
7a5a03869801e2 Milena Olech 2025-08-29  1697  static void idpf_get_ts_stats(struct net_device *netdev,
7a5a03869801e2 Milena Olech 2025-08-29  1698  			      struct ethtool_ts_stats *ts_stats)
7a5a03869801e2 Milena Olech 2025-08-29  1699  {
7a5a03869801e2 Milena Olech 2025-08-29  1700  	struct idpf_netdev_priv *np = netdev_priv(netdev);
7a5a03869801e2 Milena Olech 2025-08-29  1701  	struct idpf_vport *vport;
7a5a03869801e2 Milena Olech 2025-08-29  1702  	unsigned int start;
7a5a03869801e2 Milena Olech 2025-08-29  1703  
7a5a03869801e2 Milena Olech 2025-08-29  1704  	idpf_vport_ctrl_lock(netdev);
7a5a03869801e2 Milena Olech 2025-08-29  1705  	vport = idpf_netdev_to_vport(netdev);
7a5a03869801e2 Milena Olech 2025-08-29  1706  	do {
7a5a03869801e2 Milena Olech 2025-08-29  1707  		start = u64_stats_fetch_begin(&vport->tstamp_stats.stats_sync);
7a5a03869801e2 Milena Olech 2025-08-29  1708  		ts_stats->pkts = u64_stats_read(&vport->tstamp_stats.packets);
7a5a03869801e2 Milena Olech 2025-08-29  1709  		ts_stats->lost = u64_stats_read(&vport->tstamp_stats.flushed);
7a5a03869801e2 Milena Olech 2025-08-29  1710  		ts_stats->err = u64_stats_read(&vport->tstamp_stats.discarded);
7a5a03869801e2 Milena Olech 2025-08-29  1711  	} while (u64_stats_fetch_retry(&vport->tstamp_stats.stats_sync, start));
7a5a03869801e2 Milena Olech 2025-08-29  1712  
7a5a03869801e2 Milena Olech 2025-08-29 @1713  	if (np->state != __IDPF_VPORT_UP)
7a5a03869801e2 Milena Olech 2025-08-29  1714  		goto exit;
7a5a03869801e2 Milena Olech 2025-08-29  1715  
7a5a03869801e2 Milena Olech 2025-08-29  1716  	for (u16 i = 0; i < vport->num_txq_grp; i++) {
7a5a03869801e2 Milena Olech 2025-08-29  1717  		struct idpf_txq_group *txq_grp = &vport->txq_grps[i];
7a5a03869801e2 Milena Olech 2025-08-29  1718  
7a5a03869801e2 Milena Olech 2025-08-29  1719  		for (u16 j = 0; j < txq_grp->num_txq; j++) {
7a5a03869801e2 Milena Olech 2025-08-29  1720  			struct idpf_tx_queue *txq = txq_grp->txqs[j];
7a5a03869801e2 Milena Olech 2025-08-29  1721  			struct idpf_tx_queue_stats *stats;
7a5a03869801e2 Milena Olech 2025-08-29  1722  			u64 ts;
7a5a03869801e2 Milena Olech 2025-08-29  1723  
7a5a03869801e2 Milena Olech 2025-08-29  1724  			if (!txq)
7a5a03869801e2 Milena Olech 2025-08-29  1725  				continue;
7a5a03869801e2 Milena Olech 2025-08-29  1726  
7a5a03869801e2 Milena Olech 2025-08-29  1727  			stats = &txq->q_stats;
7a5a03869801e2 Milena Olech 2025-08-29  1728  			do {
7a5a03869801e2 Milena Olech 2025-08-29  1729  				start = u64_stats_fetch_begin(&txq->stats_sync);
7a5a03869801e2 Milena Olech 2025-08-29  1730  
7a5a03869801e2 Milena Olech 2025-08-29  1731  				ts = u64_stats_read(&stats->tstamp_skipped);
7a5a03869801e2 Milena Olech 2025-08-29  1732  			} while (u64_stats_fetch_retry(&txq->stats_sync,
7a5a03869801e2 Milena Olech 2025-08-29  1733  						       start));
7a5a03869801e2 Milena Olech 2025-08-29  1734  
7a5a03869801e2 Milena Olech 2025-08-29  1735  			ts_stats->lost += ts;
7a5a03869801e2 Milena Olech 2025-08-29  1736  		}
7a5a03869801e2 Milena Olech 2025-08-29  1737  	}
7a5a03869801e2 Milena Olech 2025-08-29  1738  
7a5a03869801e2 Milena Olech 2025-08-29  1739  exit:
7a5a03869801e2 Milena Olech 2025-08-29  1740  	idpf_vport_ctrl_unlock(netdev);
7a5a03869801e2 Milena Olech 2025-08-29  1741  }
7a5a03869801e2 Milena Olech 2025-08-29  1742  

:::::: The code at line 1713 was first introduced by commit
:::::: 7a5a03869801e2f1cabdc55b2e697fea20da5c68 idpf: add HW timestamping statistics

:::::: TO: Milena Olech <milena.olech@intel.com>
:::::: CC: Tony Nguyen <anthony.l.nguyen@intel.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2025-10-04  8:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-04  8:09 kernel test robot [this message]
2025-10-04  8:09 ` [tnguy-net-queue:dev-queue 7/17] drivers/net/ethernet/intel/idpf/idpf_ethtool.c:1713:10: warning: comparison of array 'np->state' not equal to a null pointer is always true 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=202510041605.cSnfIA5l-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=emil.s.tantilov@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=madhu.chittim@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=przemyslaw.kitszel@intel.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.