public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] iio: orientation: hid-sensor-rotation: fix quaternion alignment
@ 2026-02-14 21:00 David Lechner
  2026-02-14 21:00 ` [PATCH 1/2] iio: add IIO_DECLARE_REPEATED_ELEMENT() macro David Lechner
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: David Lechner @ 2026-02-14 21:00 UTC (permalink / raw)
  To: Jonathan Cameron, Nuno Sá, Andy Shevchenko, Jiri Kosina,
	Srinivas Pandruvada
  Cc: linux-iio, linux-kernel, Jonathan Cameron, linux-input,
	David Lechner, Lixu Zhang

The main point of this series is to fix a regression reported in
hid-sensor-rotation where the alignment of the quaternion field in the
data was inadvertently changed from 16 bytes to 8 bytes. This is an
unusually case (one of only 2 in the kernel) where the .repeat field of
struct iio_scan_type is used and we have such a requirement. (The other
case uses u16 instead of u32, so it wasn't affected.)

To make the reason for the alignment more explicit to future readers,
we introduce a new macro, IIO_DECLARE_REPEATED_ELEMENT, to declare the
array with proper allignment. This is meant to follow the pattern of
the similar IIO_DECLARE_BUFFER_WITH_TS() macro.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
David Lechner (2):
      iio: add IIO_DECLARE_REPEATED_ELEMENT() macro
      iio: orientation: hid-sensor-rotation: fix quaternion alignment

 drivers/iio/orientation/hid-sensor-rotation.c |  2 +-
 include/linux/iio/iio.h                       | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)
---
base-commit: 0f11bb7985ceef2aeeb5c45c3c7bfff3f5a16e03
change-id: 20260214-iio-fix-repeat-alignment-575b2c009e25

Best regards,
-- 
David Lechner <dlechner@baylibre.com>


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-02-24  2:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-14 21:00 [PATCH 0/2] iio: orientation: hid-sensor-rotation: fix quaternion alignment David Lechner
2026-02-14 21:00 ` [PATCH 1/2] iio: add IIO_DECLARE_REPEATED_ELEMENT() macro David Lechner
2026-02-14 21:00 ` [PATCH 2/2] iio: orientation: hid-sensor-rotation: fix quaternion alignment David Lechner
2026-02-16  7:45   ` Andy Shevchenko
2026-02-24  2:35   ` Zhang, Lixu
2026-02-16  7:44 ` [PATCH 0/2] " Andy Shevchenko
2026-02-16 15:25   ` David Lechner
2026-02-17  8:10     ` Andy Shevchenko
2026-02-18 19:52       ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox