* [ti:ti-linux-5.10.y 6232/6239] drivers/net/ethernet/ti/cpsw.c:916:15: warning: variable 'len' set but not used
@ 2021-06-22 23:23 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-06-22 23:23 UTC (permalink / raw
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3997 bytes --]
tree: git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-linux-5.10.y
head: f7b090401f267663c4885c918e959557b43c91f9
commit: 6853acd9be4e17522e3c3b2ec30c3ce8e46b6b9e [6232/6239] HACK: net: ethernet: ti: cpsw: allow to configure min tx packet size
config: arm-randconfig-p001-20210622 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.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-9.3.0 make.cross ARCH=arm
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:15: warning: variable 'len' set but not used [-Wunused-but-set-variable]
916 | unsigned int len;
| ^~~
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
^
>> drivers/net/ethernet/ti/cpsw_priv.h:406:21: warning: Unused variable: ndev [unusedVariable]
struct net_device *ndev;
^
>> drivers/net/ethernet/ti/cpsw_priv.h:407:6: warning: Unused variable: ch [unusedVariable]
int ch;
^
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(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 40639 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-22 23:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-22 23:23 [ti:ti-linux-5.10.y 6232/6239] drivers/net/ethernet/ti/cpsw.c:916:15: warning: variable 'len' set but not used 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.