From: kernel test robot <yujie.liu@intel.com>
To: Johannes Berg <johannes.berg@intel.com>
Cc: <llvm@lists.linux.dev>, <kbuild-all@lists.01.org>,
"Linux Memory Management List" <linux-mm@kvack.org>
Subject: [linux-next:master 9724/13542] net/mac80211/mlme.c:1161:4: warning: Value stored to 'at_extension' is never read [clang-analyzer-deadcode.DeadStores]
Date: Fri, 5 Aug 2022 11:06:06 +0800 [thread overview]
Message-ID: <a2ba8e2a-60f6-0c85-8df6-7881ff6a763e@intel.com> (raw)
In-Reply-To: <202208030858.knIauqwf-lkp@intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 7c5e07b73ff3011c9b82d4a3286a3362b951ad2b
commit: 81151ce462e533551f3284bfdb8e0f461c9220e6 [9724/13542] wifi: mac80211: support MLO authentication/association with one link
config: x86_64-randconfig-c007 (https://download.01.org/0day-ci/archive/20220803/202208030858.knIauqwf-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 52cd00cabf479aa7eb6dbb063b7ba41ea57bce9e)
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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=81151ce462e533551f3284bfdb8e0f461c9220e6
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 81151ce462e533551f3284bfdb8e0f461c9220e6
# save the config file
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <yujie.liu@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
>> net/mac80211/mlme.c:1161:4: warning: Value stored to 'at_extension' is never read [clang-analyzer-deadcode.DeadStores]
at_extension = true;
^ ~~~~
vim +/at_extension +1161 net/mac80211/mlme.c
978420c2105ca9 Johannes Berg 2022-07-12 1137
81151ce462e533 Johannes Berg 2022-06-01 1138 static void ieee80211_add_non_inheritance_elem(struct sk_buff *skb,
81151ce462e533 Johannes Berg 2022-06-01 1139 const u16 *outer,
81151ce462e533 Johannes Berg 2022-06-01 1140 const u16 *inner)
81151ce462e533 Johannes Berg 2022-06-01 1141 {
81151ce462e533 Johannes Berg 2022-06-01 1142 unsigned int skb_len = skb->len;
81151ce462e533 Johannes Berg 2022-06-01 1143 bool added = false;
81151ce462e533 Johannes Berg 2022-06-01 1144 int i, j;
81151ce462e533 Johannes Berg 2022-06-01 1145 u8 *len, *list_len = NULL;
81151ce462e533 Johannes Berg 2022-06-01 1146
81151ce462e533 Johannes Berg 2022-06-01 1147 skb_put_u8(skb, WLAN_EID_EXTENSION);
81151ce462e533 Johannes Berg 2022-06-01 1148 len = skb_put(skb, 1);
81151ce462e533 Johannes Berg 2022-06-01 1149 skb_put_u8(skb, WLAN_EID_EXT_NON_INHERITANCE);
81151ce462e533 Johannes Berg 2022-06-01 1150
81151ce462e533 Johannes Berg 2022-06-01 1151 for (i = 0; i < PRESENT_ELEMS_MAX && outer[i]; i++) {
81151ce462e533 Johannes Berg 2022-06-01 1152 u16 elem = outer[i];
81151ce462e533 Johannes Berg 2022-06-01 1153 bool have_inner = false;
81151ce462e533 Johannes Berg 2022-06-01 @1154 bool at_extension = false;
81151ce462e533 Johannes Berg 2022-06-01 1155
81151ce462e533 Johannes Berg 2022-06-01 1156 /* should at least be sorted in the sense of normal -> ext */
81151ce462e533 Johannes Berg 2022-06-01 1157 WARN_ON(at_extension && elem < PRESENT_ELEM_EXT_OFFS);
81151ce462e533 Johannes Berg 2022-06-01 1158
81151ce462e533 Johannes Berg 2022-06-01 1159 /* switch to extension list */
81151ce462e533 Johannes Berg 2022-06-01 1160 if (!at_extension && elem >= PRESENT_ELEM_EXT_OFFS) {
81151ce462e533 Johannes Berg 2022-06-01 @1161 at_extension = true;
81151ce462e533 Johannes Berg 2022-06-01 1162 if (!list_len)
81151ce462e533 Johannes Berg 2022-06-01 1163 skb_put_u8(skb, 0);
81151ce462e533 Johannes Berg 2022-06-01 1164 list_len = NULL;
81151ce462e533 Johannes Berg 2022-06-01 1165 }
81151ce462e533 Johannes Berg 2022-06-01 1166
81151ce462e533 Johannes Berg 2022-06-01 1167 for (j = 0; j < PRESENT_ELEMS_MAX && inner[j]; j++) {
81151ce462e533 Johannes Berg 2022-06-01 1168 if (elem == inner[j]) {
81151ce462e533 Johannes Berg 2022-06-01 1169 have_inner = true;
81151ce462e533 Johannes Berg 2022-06-01 1170 break;
81151ce462e533 Johannes Berg 2022-06-01 1171 }
81151ce462e533 Johannes Berg 2022-06-01 1172 }
81151ce462e533 Johannes Berg 2022-06-01 1173
81151ce462e533 Johannes Berg 2022-06-01 1174 if (have_inner)
81151ce462e533 Johannes Berg 2022-06-01 1175 continue;
81151ce462e533 Johannes Berg 2022-06-01 1176
81151ce462e533 Johannes Berg 2022-06-01 1177 if (!list_len) {
81151ce462e533 Johannes Berg 2022-06-01 1178 list_len = skb_put(skb, 1);
81151ce462e533 Johannes Berg 2022-06-01 1179 *list_len = 0;
81151ce462e533 Johannes Berg 2022-06-01 1180 }
81151ce462e533 Johannes Berg 2022-06-01 1181 *list_len += 1;
81151ce462e533 Johannes Berg 2022-06-01 1182 skb_put_u8(skb, (u8)elem);
81151ce462e533 Johannes Berg 2022-06-01 1183 }
81151ce462e533 Johannes Berg 2022-06-01 1184
81151ce462e533 Johannes Berg 2022-06-01 1185 if (!added)
81151ce462e533 Johannes Berg 2022-06-01 1186 skb_trim(skb, skb_len);
81151ce462e533 Johannes Berg 2022-06-01 1187 else
81151ce462e533 Johannes Berg 2022-06-01 1188 *len = skb->len - skb_len - 2;
81151ce462e533 Johannes Berg 2022-06-01 1189 }
81151ce462e533 Johannes Berg 2022-06-01 1190
--
0-DAY CI Kernel Test Service
https://01.org/lkp
parent reply other threads:[~2022-08-05 3:06 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <202208030858.knIauqwf-lkp@intel.com>]
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=a2ba8e2a-60f6-0c85-8df6-7881ff6a763e@intel.com \
--to=yujie.liu@intel.com \
--cc=johannes.berg@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=llvm@lists.linux.dev \
/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