From: kernel test robot <lkp@intel.com>
To: Felix Fietkau <nbd@nbd.name>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org
Subject: [nbd168-wireless:mtk-flow-offload 9/9] drivers/net/wireless/mediatek/mt76/dma.c:145:17: warning: variable 'ring' set but not used
Date: Tue, 15 Feb 2022 03:02:05 +0800 [thread overview]
Message-ID: <202202150257.O7iGQocg-lkp@intel.com> (raw)
tree: https://github.com/nbd168/wireless mtk-flow-offload
head: 6dbc6b1e07e9f4face597784cf4069cff9f3a043
commit: 6dbc6b1e07e9f4face597784cf4069cff9f3a043 [9/9] mt76: mt7915: add Wireless Ethernet Dispatch support
config: x86_64-randconfig-a005-20220214 (https://download.01.org/0day-ci/archive/20220215/202202150257.O7iGQocg-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project ea071884b0cc7210b3cc5fe858f0e892a779a23b)
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
# https://github.com/nbd168/wireless/commit/6dbc6b1e07e9f4face597784cf4069cff9f3a043
git remote add nbd168-wireless https://github.com/nbd168/wireless
git fetch --no-tags nbd168-wireless mtk-flow-offload
git checkout 6dbc6b1e07e9f4face597784cf4069cff9f3a043
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/wireless/mediatek/mt76/
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/wireless/mediatek/mt76/dma.c:145:17: warning: variable 'ring' set but not used [-Wunused-but-set-variable]
int ret, type, ring;
^
>> drivers/net/wireless/mediatek/mt76/dma.c:165:7: warning: variable 'ret' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
case MT76_WED_Q_TXFREE:
^~~~~~~~~~~~~~~~~
drivers/net/wireless/mediatek/mt76/dma.c:182:9: note: uninitialized use occurs here
return ret;
^~~
drivers/net/wireless/mediatek/mt76/dma.c:158:7: warning: variable 'ret' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
case MT76_WED_Q_TX:
^~~~~~~~~~~~~
drivers/net/wireless/mediatek/mt76/dma.c:182:9: note: uninitialized use occurs here
return ret;
^~~
drivers/net/wireless/mediatek/mt76/dma.c:145:9: note: initialize the variable 'ret' to silence this warning
int ret, type, ring;
^
= 0
3 warnings generated.
vim +/ring +145 drivers/net/wireless/mediatek/mt76/dma.c
140
141 static int
142 mt76_dma_wed_setup(struct mt76_dev *dev, struct mt76_queue *q)
143 {
144 struct mtk_wed_device *wed = &dev->mmio.wed;
> 145 int ret, type, ring;
146 u8 flags = q->flags;
147
148 if (!mtk_wed_device_active(wed))
149 q->flags &= ~MT_QFLAG_WED;
150
151 if (!(q->flags & MT_QFLAG_WED))
152 return 0;
153
154 type = FIELD_GET(MT_QFLAG_WED_TYPE, q->flags);
155 ring = FIELD_GET(MT_QFLAG_WED_RING, q->flags);
156
157 switch (type) {
158 case MT76_WED_Q_TX:
159 #ifdef CONFIG_NET_MEDIATEK_SOC_WED
160 ret = mtk_wed_device_tx_ring_setup(wed, ring, q->regs);
161 if (!ret)
162 q->wed_regs = wed->tx_ring[ring].reg_base;
163 #endif
164 break;
> 165 case MT76_WED_Q_TXFREE:
166 /* WED txfree queue needs ring to be initialized before setup */
167 q->flags = 0;
168 mt76_dma_queue_reset(dev, q);
169 mt76_dma_rx_fill(dev, q);
170 q->flags = flags;
171
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
reply other threads:[~2022-02-14 19:08 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=202202150257.O7iGQocg-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nbd@nbd.name \
/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
all inboxes | Powered by JetHome®