iio: magnetometer: Use aligned_s64 instead of open coding alignment.

Use this new type to both slightly simplify the code and avoid
confusing static analysis tools. Mostly this series is about consistency
to avoid this code pattern getting copied into more drivers.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20241215182912.481706-8-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Jonathan Cameron 2024-12-15 18:28:58 +00:00
parent adfaea544e
commit 8d7940857f
7 changed files with 7 additions and 7 deletions

View File

@ -360,7 +360,7 @@ static irqreturn_t af8133j_trigger_handler(int irq, void *p)
s64 timestamp = iio_get_time_ns(indio_dev);
struct {
__le16 values[3];
s64 timestamp __aligned(8);
aligned_s64 timestamp;
} sample;
int ret;

View File

@ -197,7 +197,7 @@ struct ak8974 {
/* Ensure timestamp is naturally aligned */
struct {
__le16 channels[3];
s64 ts __aligned(8);
aligned_s64 ts;
} scan;
};

View File

@ -426,7 +426,7 @@ struct ak8975_data {
/* Ensure natural alignment of timestamp */
struct {
s16 channels[3];
s64 ts __aligned(8);
aligned_s64 ts;
} scan;
};

View File

@ -140,7 +140,7 @@ struct bmc150_magn_data {
/* Ensure timestamp is naturally aligned */
struct {
s32 chans[3];
s64 timestamp __aligned(8);
aligned_s64 timestamp;
} scan;
struct iio_trigger *dready_trig;
bool dready_trigger_on;

View File

@ -44,7 +44,7 @@ struct hmc5843_data {
struct iio_mount_matrix orientation;
struct {
__be16 chans[3];
s64 timestamp __aligned(8);
aligned_s64 timestamp;
} scan;
};

View File

@ -60,7 +60,7 @@ struct mag3110_data {
struct {
__be16 channels[3];
u8 temperature;
s64 ts __aligned(8);
aligned_s64 ts;
} scan;
};

View File

@ -236,7 +236,7 @@ struct yas5xx {
*/
struct {
s32 channels[4];
s64 ts __aligned(8);
aligned_s64 ts;
} scan;
};