From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: David Lechner <dlechner@baylibre.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Jiri Kosina" <jikos@kernel.org>,
"Srinivas Pandruvada" <srinivas.pandruvada@linux.intel.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
linux-input@vger.kernel.org, "Lixu Zhang" <lixu.zhang@intel.com>
Subject: Re: [PATCH 2/2] iio: orientation: hid-sensor-rotation: fix quaternion alignment
Date: Mon, 16 Feb 2026 09:45:15 +0200 [thread overview]
Message-ID: <aZLLCzkFg4PVDziP@smile.fi.intel.com> (raw)
In-Reply-To: <20260214-iio-fix-repeat-alignment-v1-2-47f01288c803@baylibre.com>
On Sat, Feb 14, 2026 at 03:00:21PM -0600, David Lechner wrote:
> Restore the alignment of sampled_vals to 16 bytes by using
> IIO_DECLARE_REPEATED_ELEMENT(). This field contains a quaternion value
> which 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.
...
> struct {
> - s32 sampled_vals[4];
> + IIO_DECLARE_REPEATED_ELEMENT(s32, sampled_vals, 4);
This becomes
IIO_DECLARE_QUATERNION(s32, sampled_vals);
> aligned_s64 timestamp;
> } scan;
In the similar way we can address drivers/iio/imu/bno055/bno055.c.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-02-16 7:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=aZLLCzkFg4PVDziP@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=jikos@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lixu.zhang@intel.com \
--cc=nuno.sa@analog.com \
--cc=srinivas.pandruvada@linux.intel.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