* Re: [jic23-iio:testing 69/79] drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c:41:39: warning: field accel within 'struct inv_icm45600_fifo_2sensors_packet' is less aligned than 'struct inv_icm45600_fifo_sensor_data' and is usually due to 'struct inv_icm45600_fifo_2sensors_packet' b...
[not found] <202510160550.GqthmiPd-lkp@intel.com>
@ 2025-10-19 10:55 ` Jonathan Cameron
0 siblings, 0 replies; only message in thread
From: Jonathan Cameron @ 2025-10-19 10:55 UTC (permalink / raw)
To: kernel test robot
Cc: Remi Buisson, oe-kbuild-all, Jonathan Cameron, linux-iio
On Thu, 16 Oct 2025 05:18:31 +0800
kernel test robot <lkp@intel.com> wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git testing
> head: 4b17a60d1e1c2d9d2ccbd58642f6f4ac2fa364ba
> commit: c7dd90861c9052f7e28ef93fa03aeb94cb5dc43b [69/79] iio: imu: inv_icm45600: add I2C driver for inv_icm45600 driver
> config: arm-randconfig-r072-20251016 (https://download.01.org/0day-ci/archive/20251016/202510160550.GqthmiPd-lkp@intel.com/config)
> compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 39f292ffa13d7ca0d1edff27ac8fd55024bb4d19)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251016/202510160550.GqthmiPd-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202510160550.GqthmiPd-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> >> drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c:41:39: warning: field accel within 'struct inv_icm45600_fifo_2sensors_packet' is less aligned than 'struct inv_icm45600_fifo_sensor_data' and is usually due to 'struct inv_icm45600_fifo_2sensors_packet' being packed, which can lead to unaligned accesses [-Wunaligned-access]
> 41 | struct inv_icm45600_fifo_sensor_data accel;
> | ^
> >> drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c:42:39: warning: field gyro within 'struct inv_icm45600_fifo_2sensors_packet' is less aligned than 'struct inv_icm45600_fifo_sensor_data' and is usually due to 'struct inv_icm45600_fifo_2sensors_packet' being packed, which can lead to unaligned accesses [-Wunaligned-access]
> 42 | struct inv_icm45600_fifo_sensor_data gyro;
> | ^
> >> drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c:35:39: warning: field data within 'struct inv_icm45600_fifo_1sensor_packet' is less aligned than 'struct inv_icm45600_fifo_sensor_data' and is usually due to 'struct inv_icm45600_fifo_1sensor_packet' being packed, which can lead to unaligned accesses [-Wunaligned-access]
> 35 | struct inv_icm45600_fifo_sensor_data data;
> | ^
> 3 warnings generated.
>
>
> vim +41 drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c
>
> 7e1e1e37402c95 Remi Buisson 2025-10-07 32
> 7e1e1e37402c95 Remi Buisson 2025-10-07 33 struct inv_icm45600_fifo_1sensor_packet {
> 7e1e1e37402c95 Remi Buisson 2025-10-07 34 u8 header;
> 7e1e1e37402c95 Remi Buisson 2025-10-07 @35 struct inv_icm45600_fifo_sensor_data data;
> 7e1e1e37402c95 Remi Buisson 2025-10-07 36 s8 temp;
> 7e1e1e37402c95 Remi Buisson 2025-10-07 37 } __packed;
> 7e1e1e37402c95 Remi Buisson 2025-10-07 38
> 7e1e1e37402c95 Remi Buisson 2025-10-07 39 struct inv_icm45600_fifo_2sensors_packet {
> 7e1e1e37402c95 Remi Buisson 2025-10-07 40 u8 header;
> 7e1e1e37402c95 Remi Buisson 2025-10-07 @41 struct inv_icm45600_fifo_sensor_data accel;
> 7e1e1e37402c95 Remi Buisson 2025-10-07 @42 struct inv_icm45600_fifo_sensor_data gyro;
> 7e1e1e37402c95 Remi Buisson 2025-10-07 43 s8 temp;
> 7e1e1e37402c95 Remi Buisson 2025-10-07 44 __le16 timestamp;
> 7e1e1e37402c95 Remi Buisson 2025-10-07 45 } __packed;
> 7e1e1e37402c95 Remi Buisson 2025-10-07 46
So this seems to be a new warning that older versions of clang don't generate (20 doesn't
for instance).
I'm not 100% sure though on the fix.
Is marking struct inv_icm45600_fifo_sensor_data __packed sufficient? I'll add that
to the tree and push out again.
Jonathan
>
> :::::: The code at line 41 was first introduced by commit
> :::::: 7e1e1e37402c95acd5ae6aace9e363a982038b11 iio: imu: inv_icm45600: add buffer support in iio devices
>
> :::::: TO: Remi Buisson <remi.buisson@tdk.com>
> :::::: CC: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
^ permalink raw reply [flat|nested] only message in thread