linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [ti:ti-linux-5.10.y 6791/9578] drivers/net/ethernet/ti/cpsw.c:916:22: warning: variable 'len' set but not used
@ 2021-10-11  9:48 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-10-11  9:48 UTC (permalink / raw)
  To: Grygorii Strashko; +Cc: kbuild-all, linux-kernel, Vignesh Raghavendra

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

tree:   git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-linux-5.10.y
head:   f25fed53436a83d746c481ba852b3d4c10d0bab0
commit: 6853acd9be4e17522e3c3b2ec30c3ce8e46b6b9e [6791/9578] HACK: net: ethernet: ti: cpsw: allow to configure min tx packet size
config: alpha-allmodconfig (attached as .config)
compiler: alpha-linux-gcc (GCC) 11.2.0
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
        git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
        git fetch --no-tags ti ti-linux-5.10.y
        git checkout 6853acd9be4e17522e3c3b2ec30c3ce8e46b6b9e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=alpha 

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/ti/cpsw.c: In function 'cpsw_ndo_start_xmit':
>> drivers/net/ethernet/ti/cpsw.c:916:22: warning: variable 'len' set but not used [-Wunused-but-set-variable]
     916 |         unsigned int len;
         |                      ^~~


vim +/len +916 drivers/net/ethernet/ti/cpsw.c

   907	
   908	static netdev_tx_t cpsw_ndo_start_xmit(struct sk_buff *skb,
   909					       struct net_device *ndev)
   910	{
   911		struct cpsw_priv *priv = netdev_priv(ndev);
   912		struct cpsw_common *cpsw = priv->cpsw;
   913		struct cpts *cpts = cpsw->cpts;
   914		struct netdev_queue *txq;
   915		struct cpdma_chan *txch;
 > 916		unsigned int len;
   917		int ret, q_idx;
   918	
   919		if (skb_padto(skb, tx_packet_min)) {
   920			cpsw_err(priv, tx_err, "packet pad failed\n");
   921			ndev->stats.tx_dropped++;
   922			return NET_XMIT_DROP;
   923		}
   924	
   925		len = skb->len < tx_packet_min ? tx_packet_min : skb->len;
   926	
   927		if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP &&
   928		    priv->tx_ts_enabled && cpts_can_timestamp(cpts, skb))
   929			skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
   930	
   931		q_idx = skb_get_queue_mapping(skb);
   932		if (q_idx >= cpsw->tx_ch_num)
   933			q_idx = q_idx % cpsw->tx_ch_num;
   934	
   935		txch = cpsw->txv[q_idx].ch;
   936		txq = netdev_get_tx_queue(ndev, q_idx);
   937		skb_tx_timestamp(skb);
   938		ret = cpdma_chan_submit(txch, skb, skb->data, skb->len,
   939					priv->emac_port + cpsw->data.dual_emac);
   940		if (unlikely(ret != 0)) {
   941			cpsw_err(priv, tx_err, "desc submit failed\n");
   942			goto fail;
   943		}
   944	
   945		/* If there is no more tx desc left free then we need to
   946		 * tell the kernel to stop sending us tx frames.
   947		 */
   948		if (unlikely(!cpdma_check_free_tx_desc(txch))) {
   949			netif_tx_stop_queue(txq);
   950	
   951			/* Barrier, so that stop_queue visible to other cpus */
   952			smp_mb__after_atomic();
   953	
   954			if (cpdma_check_free_tx_desc(txch))
   955				netif_tx_wake_queue(txq);
   956		}
   957	
   958		return NETDEV_TX_OK;
   959	fail:
   960		ndev->stats.tx_dropped++;
   961		netif_tx_stop_queue(txq);
   962	
   963		/* Barrier, so that stop_queue visible to other cpus */
   964		smp_mb__after_atomic();
   965	
   966		if (cpdma_check_free_tx_desc(txch))
   967			netif_tx_wake_queue(txq);
   968	
   969		return NETDEV_TX_BUSY;
   970	}
   971	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-11  9:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11  9:48 [ti:ti-linux-5.10.y 6791/9578] drivers/net/ethernet/ti/cpsw.c:916:22: warning: variable 'len' set but not used kernel test robot

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).