[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202301051956.oK4DJyUp-lkp@intel.com>
Date: Thu, 5 Jan 2023 19:32:46 +0800
From: kernel test robot <lkp@...el.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: drivers/scsi/pm8001/pm8001_hwi.h:402:2: warning: field within
'struct smp_req' is less aligned than 'union smp_req::(anonymous at
drivers/scsi/pm8001/pm8001_hwi.h:402:2)' and is usually due to 'struct
smp_req' being packed, which can lead to unaligned ac...
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 41c03ba9beea760bd2d2ac9250b09a2e192da2dc
commit: 7036440eab3e2d47a775d4616909f8235488d714 ARM: omap1: enable multiplatform
date: 7 months ago
config: arm-randconfig-r024-20230105
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 8d9828ef5aa9688500657d36cd2aefbe12bbd162)
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=7036440eab3e2d47a775d4616909f8235488d714
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 7036440eab3e2d47a775d4616909f8235488d714
# 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 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/scsi/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
In file included from drivers/scsi/pm8001/pm8001_hwi.c:42:
>> drivers/scsi/pm8001/pm8001_hwi.h:402:2: warning: field within 'struct smp_req' is less aligned than 'union smp_req::(anonymous at drivers/scsi/pm8001/pm8001_hwi.h:402:2)' and is usually due to 'struct smp_req' being packed, which can lead to unaligned accesses [-Wunaligned-access]
union {
^
In file included from drivers/scsi/pm8001/pm8001_hwi.c:40:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:62:
In file included from include/linux/lockdep.h:14:
In file included from include/linux/smp.h:13:
In file included from include/linux/cpumask.h:12:
In file included from include/linux/bitmap.h:11:
In file included from include/linux/string.h:253:
include/linux/fortify-string.h:352:4: warning: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
__read_overflow2_field(q_size_field, size);
^
2 warnings generated.
--
In file included from drivers/scsi/pm8001/pm80xx_hwi.c:42:
>> drivers/scsi/pm8001/pm80xx_hwi.h:639:2: warning: field within 'struct smp_req' is less aligned than 'union smp_req::(anonymous at drivers/scsi/pm8001/pm80xx_hwi.h:639:2)' and is usually due to 'struct smp_req' being packed, which can lead to unaligned accesses [-Wunaligned-access]
union {
^
In file included from drivers/scsi/pm8001/pm80xx_hwi.c:40:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:62:
In file included from include/linux/lockdep.h:14:
In file included from include/linux/smp.h:13:
In file included from include/linux/cpumask.h:12:
In file included from include/linux/bitmap.h:11:
In file included from include/linux/string.h:253:
include/linux/fortify-string.h:352:4: warning: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
__read_overflow2_field(q_size_field, size);
^
2 warnings generated.
vim +402 drivers/scsi/pm8001/pm8001_hwi.h
dbf9bfe615717d jack wang 2009-10-14 387
dbf9bfe615717d jack wang 2009-10-14 388 /*
dbf9bfe615717d jack wang 2009-10-14 389 * brief the data structure of SMP Request Command
dbf9bfe615717d jack wang 2009-10-14 390 * use to describe MPI SMP REQUEST Command (64 bytes)
dbf9bfe615717d jack wang 2009-10-14 391 */
dbf9bfe615717d jack wang 2009-10-14 392 struct smp_req {
dbf9bfe615717d jack wang 2009-10-14 393 __le32 tag;
dbf9bfe615717d jack wang 2009-10-14 394 __le32 device_id;
dbf9bfe615717d jack wang 2009-10-14 395 __le32 len_ip_ir;
dbf9bfe615717d jack wang 2009-10-14 396 /* Bits [0] - Indirect response */
dbf9bfe615717d jack wang 2009-10-14 397 /* Bits [1] - Indirect Payload */
dbf9bfe615717d jack wang 2009-10-14 398 /* Bits [15:2] - Reserved */
dbf9bfe615717d jack wang 2009-10-14 399 /* Bits [23:16] - direct payload Len */
dbf9bfe615717d jack wang 2009-10-14 400 /* Bits [31:24] - Reserved */
dbf9bfe615717d jack wang 2009-10-14 401 u8 smp_req16[16];
dbf9bfe615717d jack wang 2009-10-14 @402 union {
dbf9bfe615717d jack wang 2009-10-14 403 u8 smp_req[32];
dbf9bfe615717d jack wang 2009-10-14 404 struct {
dbf9bfe615717d jack wang 2009-10-14 405 __le64 long_req_addr;/* sg dma address, LE */
dbf9bfe615717d jack wang 2009-10-14 406 __le32 long_req_size;/* LE */
dbf9bfe615717d jack wang 2009-10-14 407 u32 _r_a;
dbf9bfe615717d jack wang 2009-10-14 408 __le64 long_resp_addr;/* sg dma address, LE */
dbf9bfe615717d jack wang 2009-10-14 409 __le32 long_resp_size;/* LE */
dbf9bfe615717d jack wang 2009-10-14 410 u32 _r_b;
dbf9bfe615717d jack wang 2009-10-14 411 } long_smp_req;/* sequencer extension */
dbf9bfe615717d jack wang 2009-10-14 412 };
dbf9bfe615717d jack wang 2009-10-14 413 } __attribute__((packed, aligned(4)));
dbf9bfe615717d jack wang 2009-10-14 414 /*
dbf9bfe615717d jack wang 2009-10-14 415 * brief the data structure of SMP Completion Response
dbf9bfe615717d jack wang 2009-10-14 416 * use to describe MPI SMP Completion Response (64 bytes)
dbf9bfe615717d jack wang 2009-10-14 417 */
dbf9bfe615717d jack wang 2009-10-14 418 struct smp_completion_resp {
dbf9bfe615717d jack wang 2009-10-14 419 __le32 tag;
dbf9bfe615717d jack wang 2009-10-14 420 __le32 status;
dbf9bfe615717d jack wang 2009-10-14 421 __le32 param;
dbf9bfe615717d jack wang 2009-10-14 422 __le32 _r_a[12];
dbf9bfe615717d jack wang 2009-10-14 423 } __attribute__((packed, aligned(4)));
dbf9bfe615717d jack wang 2009-10-14 424
:::::: The code at line 402 was first introduced by commit
:::::: dbf9bfe615717d1145f263c0049fe2328e6ed395 [SCSI] pm8001: add SAS/SATA HBA driver
:::::: TO: jack wang <jack_wang@...sh.com>
:::::: CC: James Bottomley <James.Bottomley@...e.de>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
View attachment "config" of type "text/plain" (198108 bytes)
Powered by blists - more mailing lists