public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Rafał Miłecki" <rafal@milecki.pl>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	linux-kernel@vger.kernel.org
Subject: drivers/net/ethernet/broadcom/bcm4908_enet.c:637:15: warning: variable 'bytes' set but not used
Date: Thu, 3 Jun 2021 05:38:50 +0800	[thread overview]
Message-ID: <202106030546.JwKJd7fo-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   324c92e5e0ee0e993bdb106fac407846ed677f6b
commit: 12bb508bfe5a564c36864b12253db23cac83bfa1 net: broadcom: bcm4908_enet: support TX interrupt
date:   3 months ago
config: powerpc64-randconfig-r026-20210602 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project d41cb6bb2607fa5c7a9df2b3dab361353657d225)
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
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=12bb508bfe5a564c36864b12253db23cac83bfa1
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 12bb508bfe5a564c36864b12253db23cac83bfa1
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

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

   In file included from drivers/net/ethernet/broadcom/bcm4908_enet.c:6:
   In file included from include/linux/delay.h:22:
   In file included from include/linux/kernel.h:11:
   In file included from include/linux/bitops.h:32:
   In file included from arch/powerpc/include/asm/bitops.h:62:
   arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
   #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
           ^
   <built-in>:310:9: note: previous definition is here
   #define __lwsync __builtin_ppc_lwsync
           ^
>> drivers/net/ethernet/broadcom/bcm4908_enet.c:637:15: warning: variable 'bytes' set but not used [-Wunused-but-set-variable]
           unsigned int bytes = 0;
                        ^
   2 warnings generated.


vim +/bytes +637 drivers/net/ethernet/broadcom/bcm4908_enet.c

   629	
   630	static int bcm4908_enet_poll_tx(struct napi_struct *napi, int weight)
   631	{
   632		struct bcm4908_enet_dma_ring *tx_ring = container_of(napi, struct bcm4908_enet_dma_ring, napi);
   633		struct bcm4908_enet *enet = container_of(tx_ring, struct bcm4908_enet, tx_ring);
   634		struct bcm4908_enet_dma_ring_bd *buf_desc;
   635		struct bcm4908_enet_dma_ring_slot *slot;
   636		struct device *dev = enet->dev;
 > 637		unsigned int bytes = 0;
   638		int handled = 0;
   639	
   640		while (handled < weight && tx_ring->read_idx != tx_ring->write_idx) {
   641			buf_desc = &tx_ring->buf_desc[tx_ring->read_idx];
   642			if (le32_to_cpu(buf_desc->ctl) & DMA_CTL_STATUS_OWN)
   643				break;
   644			slot = &tx_ring->slots[tx_ring->read_idx];
   645	
   646			dma_unmap_single(dev, slot->dma_addr, slot->len, DMA_TO_DEVICE);
   647			dev_kfree_skb(slot->skb);
   648			bytes += slot->len;
   649			if (++tx_ring->read_idx == tx_ring->length)
   650				tx_ring->read_idx = 0;
   651	
   652			handled++;
   653		}
   654	
   655		if (handled < weight) {
   656			napi_complete_done(napi, handled);
   657			bcm4908_enet_dma_ring_intrs_on(enet, tx_ring);
   658		}
   659	
   660		if (netif_queue_stopped(enet->netdev))
   661			netif_wake_queue(enet->netdev);
   662	
   663		return handled;
   664	}
   665	

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

                 reply	other threads:[~2021-06-02 21:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202106030546.JwKJd7fo-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafal@milecki.pl \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox