From: kernel test robot <lkp@intel.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org, Felix Fietkau <nbd@nbd.name>
Subject: drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c:262:17: warning: taking address of packed member 'len' of class or structure 'tlv' may result in an unaligned pointer value
Date: Mon, 25 Jul 2022 18:59:31 +0800 [thread overview]
Message-ID: <202207251801.hLXIP9Rh-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e0dccc3b76fb35bb257b4118367a883073d7390e
commit: 25702d9c55dc5fda2ad9ad8de115e50dc7394ef9 mt76: connac: rely on le16_add_cpu in mt76_connac_mcu_add_nested_tlv
date: 7 months ago
config: arm-buildonly-randconfig-r003-20220724 (https://download.01.org/0day-ci/archive/20220725/202207251801.hLXIP9Rh-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 9e88cbcc403bdf82f29259ad60ff60a8fc4434a1)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=25702d9c55dc5fda2ad9ad8de115e50dc7394ef9
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 25702d9c55dc5fda2ad9ad8de115e50dc7394ef9
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/net/wireless/mediatek/mt76/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c:262:17: warning: taking address of packed member 'len' of class or structure 'tlv' may result in an unaligned pointer value [-Waddress-of-packed-member]
le16_add_cpu(&sta_hdr->len, len);
^~~~~~~~~~~~
1 warning generated.
vim +262 drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
242
243 struct tlv *
244 mt76_connac_mcu_add_nested_tlv(struct sk_buff *skb, int tag, int len,
245 void *sta_ntlv, void *sta_wtbl)
246 {
247 struct sta_ntlv_hdr *ntlv_hdr = sta_ntlv;
248 struct tlv *sta_hdr = sta_wtbl;
249 struct tlv *ptlv, tlv = {
250 .tag = cpu_to_le16(tag),
251 .len = cpu_to_le16(len),
252 };
253 u16 ntlv;
254
255 ptlv = skb_put(skb, len);
256 memcpy(ptlv, &tlv, sizeof(tlv));
257
258 ntlv = le16_to_cpu(ntlv_hdr->tlv_num);
259 ntlv_hdr->tlv_num = cpu_to_le16(ntlv + 1);
260
261 if (sta_hdr)
> 262 le16_add_cpu(&sta_hdr->len, len);
263
264 return ptlv;
265 }
266 EXPORT_SYMBOL_GPL(mt76_connac_mcu_add_nested_tlv);
267
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-07-25 11:00 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=202207251801.hLXIP9Rh-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=lorenzo@kernel.org \
--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 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.