From: Jonathan Cameron <jic23@kernel.org>
To: kernel test robot <lkp@intel.com>
Cc: Remi Buisson <remi.buisson@tdk.com>,
oe-kbuild-all@lists.linux.dev,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
linux-iio@vger.kernel.org
Subject: 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...
Date: Sun, 19 Oct 2025 11:55:06 +0100 [thread overview]
Message-ID: <20251019115506.4cd195d8@jic23-huawei> (raw)
In-Reply-To: <202510160550.GqthmiPd-lkp@intel.com>
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>
>
parent reply other threads:[~2025-10-19 10:55 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <202510160550.GqthmiPd-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=20251019115506.4cd195d8@jic23-huawei \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=linux-iio@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=remi.buisson@tdk.com \
/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