Skip to contentSkip to conversation

patch "iio: orientation: hid-sensor-rotation: fix quaternion alignment" added to char-misc-linus

PATCH [email protected] 1 participant 1 message Mar 29

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

iio: orientation: hid-sensor-rotation: fix quaternion alignment

to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From 50d4cc74b8a720a9682a9c94f7e62a5de6b2ed3a Mon Sep 17 00:00:00 2001
From: David Lechner <[email protected]>
Date: Sat, 28 Feb 2026 14:02:23 -0600
Subject: iio: orientation: hid-sensor-rotation: fix quaternion alignment

Restore the alignment of sampled_vals to 16 bytes by using IIO_DECLARE_QUATERNION(). This field contains a quaternion value which has scan_type.repeat = 4 and storagebits = 32. So the alignment must be 16 bytes to match the assumptions of iio_storage_bytes_for_si() and also to not break userspace.

Fixes b31a74075cb4 ("iio: orientation: hid-sensor-rotation: remove unnecessary alignment")
---
 drivers/iio/orientation/hid-sensor-rotation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/orientation/hid-sensor-rotation.c +1 -1
index e759f91a710a..6806481873be 100644
@@ -19,7 +19,7 @@ struct dev_rot_state {
 	struct hid_sensor_common common_attributes;
 	struct hid_sensor_hub_attribute_info quaternion;
 	struct {
-		s32 sampled_vals[4];
+		IIO_DECLARE_QUATERNION(s32, sampled_vals);
 		aligned_s64 timestamp;
 	} scan;
 	int scale_pre_decml;
Signature · 1 line
2.53.0