iio: accel: replace s64 __aligned(8) with aligned_s64
Subsystems (4)
Jonathan Cameron
maintainerPATCH 1/1 iio: accel: replace s64 __aligned(8) with aligned_s64
From: Jonathan Cameron <[email protected]>
e4ca0e59c394 ("types: Complement the aligned types with signed 64-bit one") introduced aligned_s64. Use it for all IIO accelerometer drivers.
---
I debated whether to split this up by driver by the time we've done all IIO drivers that will be a very large number of trivial patches.
The changes are minor enough that they shouldn't present much of a backporting challenge if needed for future fixes etc.
I'm find splitting them up if people prefer.
Next on my list is to look at adding runtime checks that the buffers containing these timestamps are big enough but I want this out of the way first.
--- drivers/iio/accel/bma180.c | 3 ++- drivers/iio/accel/bma220_spi.c | 1 + drivers/iio/accel/bma400_core.c | 2 +- drivers/iio/accel/bmc150-accel.h | 3 ++- drivers/iio/accel/fxls8962af-core.c | 3 ++- drivers/iio/accel/kionix-kx022a.c | 3 ++- drivers/iio/accel/kxcjk-1013.c | 3 ++- drivers/iio/accel/kxsd9.c | 3 ++- drivers/iio/accel/mma7455_core.c | 3 ++- drivers/iio/accel/mma8452.c | 3 ++- drivers/iio/accel/msa311.c | 3 ++- drivers/iio/accel/mxc4005.c | 3 ++- drivers/iio/accel/stk8312.c | 3 ++- drivers/iio/accel/stk8ba50.c | 3 ++- 14 files changed, 26 insertions(+), 13 deletions(-)
drivers/iio/accel/bma180.c +2 -1
@@ -21,6 +21,7 @@#include <linux/regulator/consumer.h> #include <linux/slab.h> #include <linux/string.h> +#include <linux/types.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h> #include <linux/iio/buffer.h>
@@ -144,7 +145,7 @@ struct bma180_data {/* Ensure timestamp is naturally aligned */ struct {s16 chan[4 ]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan; };
drivers/iio/accel/bma220_spi.c +1 -0
@@ -9,6 +9,7 @@#include <linux/kernel.h> #include <linux/mod_devicetable.h> #include <linux/module.h> +#include <linux/types.h> #include <linux/spi/spi.h> #include <linux/iio/buffer.h>
drivers/iio/accel/bma400_core.c +1 -1
@@ -115,7 +115,7 @@ struct bma400_data {struct {__le16 buff[3 ];u8 temperature; -s64 ts__aligned(8) ; +aligned_s64 ts; } buffer__aligned(IIO_DMA_MINALIGN) ;__le16 status;__be16 duration;
drivers/iio/accel/bmc150-accel.h +2 -1
@@ -6,6 +6,7 @@#include <linux/iio/iio.h> #include <linux/mutex.h> #include <linux/regulator/consumer.h> +#include <linux/types.h> #include <linux/workqueue.h> struct regmap ;
@@ -69,7 +70,7 @@ struct bmc150_accel_data {*/ struct {__le16 channels[3 ]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan;u8 bw_bits;u32 slope_dur;
drivers/iio/accel/fxls8962af-core.c +2 -1
@@ -22,6 +22,7 @@#include <linux/property.h> #include <linux/regulator/consumer.h> #include <linux/regmap.h> +#include <linux/types.h> #include <linux/iio/buffer.h> #include <linux/iio/events.h>
@@ -163,7 +164,7 @@ struct fxls8962af_data {const struct fxls8962af_chip_info *chip_info;struct {__le16 channels[3 ]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan;int64_t timestamp, old_timestamp;/* Only used in hw fifo mode. */ struct iio_mount_matrix orientation;
drivers/iio/accel/kionix-kx022a.c +2 -1
@@ -16,6 +16,7 @@#include <linux/regulator/consumer.h> #include <linux/slab.h> #include <linux/string_choices.h> +#include <linux/types.h> #include <linux/units.h> #include <linux/iio/iio.h>
@@ -292,7 +293,7 @@ struct kx022a_data {__le16 buffer[8 ]__aligned(IIO_DMA_MINALIGN) ;struct {__le16 channels[3 ]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan; };
drivers/iio/accel/kxcjk-1013.c +2 -1
@@ -11,6 +11,7 @@#include <linux/bitops.h> #include <linux/slab.h> #include <linux/string.h> +#include <linux/types.h> #include <linux/acpi.h> #include <linux/pm.h> #include <linux/pm_runtime.h>
@@ -250,7 +251,7 @@ struct kxcjk1013_data {/* Ensure timestamp naturally aligned */ struct {s16 chans[AXIS_MAX ]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan;u8 odr_bits;u8 range;
drivers/iio/accel/kxsd9.c +2 -1
@@ -15,6 +15,7 @@#include <linux/kernel.h> #include <linux/sysfs.h> #include <linux/slab.h> +#include <linux/types.h> #include <linux/module.h> #include <linux/regmap.h> #include <linux/bitops.h>
@@ -215,7 +216,7 @@ static irqreturn_t kxsd9_trigger_handler(int irq, void *p)*/ struct {__be16 chan[4 ]; -s64 ts__aligned(8) ; +aligned_s64 ts; } hw_values;int ret;
drivers/iio/accel/mma7455_core.c +2 -1
@@ -19,6 +19,7 @@#include <linux/iio/triggered_buffer.h> #include <linux/module.h> #include <linux/regmap.h> +#include <linux/types.h> #include "mma7455.h"
@@ -58,7 +59,7 @@ struct mma7455_data {*/ struct {__le16 channels[3 ]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan; };
drivers/iio/accel/mma8452.c +2 -1
@@ -32,6 +32,7 @@#include <linux/delay.h> #include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> +#include <linux/types.h> #define MMA8452_STATUS 0x00#define MMA8452_STATUS_DRDY (BIT(2) | BIT(1) | BIT(0))
@@ -115,7 +116,7 @@ struct mma8452_data {/* Ensure correct alignment of time stamp when present */ struct {__be16 channels[3 ]; -s64 ts__aligned(8) ; +aligned_s64 ts; } buffer; };
drivers/iio/accel/msa311.c +2 -1
@@ -34,6 +34,7 @@#include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/string_choices.h> +#include <linux/types.h> #include <linux/units.h> #include <linux/iio/buffer.h>
@@ -893,7 +894,7 @@ static irqreturn_t msa311_buffer_thread(int irq, void *p)__le16 axis;struct {__le16 channels[MSA311_SI_Z +1 ]; -s64 ts__aligned(8) ; +aligned_s64 ts; } buf;memset (&buf,0 ,sizeof (buf));
drivers/iio/accel/mxc4005.c +2 -1
@@ -11,6 +11,7 @@#include <linux/iio/iio.h> #include <linux/mod_devicetable.h> #include <linux/regmap.h> +#include <linux/types.h> #include <linux/iio/sysfs.h> #include <linux/iio/trigger.h> #include <linux/iio/buffer.h>
@@ -69,7 +70,7 @@ struct mxc4005_data {/* Ensure timestamp is naturally aligned */ struct {__be16 chans[3 ]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan;bool trigger_enabled;unsigned int control;
drivers/iio/accel/stk8312.c +2 -1
@@ -12,6 +12,7 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/delay.h> +#include <linux/types.h> #include <linux/iio/buffer.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h>
@@ -105,7 +106,7 @@ struct stk8312_data {/* Ensure timestamp is naturally aligned */ struct {s8 chans[3 ]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan; };
drivers/iio/accel/stk8ba50.c +2 -1
@@ -12,6 +12,7 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/mod_devicetable.h> +#include <linux/types.h> #include <linux/iio/buffer.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h>
@@ -94,7 +95,7 @@ struct stk8ba50_data {/* Ensure timestamp is naturally aligned */ struct {s16 chans[3 ]; -s64 timetamp__aligned(8) ; +aligned_s64 timetamp; } scan; };
Signature · 1 line
2.46.2
Quoted 12 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
e4ca0e59c394("types: Complement the aligned types with signed 64-bit one") introducedaligned_s64. Use it for all IIO accelerometer drivers.Signed-off-by Jonathan Cameron <[email protected]>---
I debated whether to split this up by driver by the time we've done all IIO drivers that will be a very large number of trivial patches.
Quoted 7 lines
The changes are minor enough that they shouldn't present much of a backporting challenge if needed for future fixes etc.
I'm find splitting them up if people prefer.
Next on my list is to look at adding runtime checks that the buffers containing these timestamps are big enough but I want this out of the way first.
I agree on all your points.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Jonathan Cameron
maintainerQuoted 16 lines · On Mon, 21 Oct 2024 10:10:25 +0300 Andy Shevchenko…
Quoted 15 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
e4ca0e59c394("types: Complement the aligned types with signed 64-bit one") introducedaligned_s64. Use it for all IIO accelerometer drivers.Signed-off-by Jonathan Cameron <[email protected]>---
I debated whether to split this up by driver by the time we've done all IIO drivers that will be a very large number of trivial patches.
The changes are minor enough that they shouldn't present much of a backporting challenge if needed for future fixes etc.
Quoted 9 lines
Quoted 4 lines
I'm find splitting them up if people prefer.
Next on my list is to look at adding runtime checks that the buffers containing these timestamps are big enough but I want this out of the way first.I agree on all your points.
Reviewed-by Andy Shevchenko <[email protected]>
Applied given it's so trivial and 3 people already reviewed!
Thanks,
Jonathan
Quoted 12 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
e4ca0e59c394("types: Complement the aligned types with signed 64-bit one") introducedaligned_s64. Use it for all IIO accelerometer drivers.Signed-off-by Jonathan Cameron <[email protected]>---
I debated whether to split this up by driver by the time we've done all IIO drivers that will be a very large number of trivial patches.
Quoted 7 lines
The changes are minor enough that they shouldn't present much of a backporting challenge if needed for future fixes etc.
I'm find splitting them up if people prefer.
Next on my list is to look at adding runtime checks that the buffers containing these timestamps are big enough but I want this out of the way first.
Makes sense to me.
Quoted 5 lines
Cc Andy Shevchenko <[email protected]>--- drivers/iio/accel/kionix-kx022a.c | 3 ++- drivers/iio/accel/kxcjk-1013.c | 3 ++- drivers/iio/accel/kxsd9.c | 3 ++-
For the Kionix/ROHM seensors,
Yours,
-- Matti
Quoted 15 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
e4ca0e59c394("types: Complement the aligned types with signed 64-bit one") introducedaligned_s64. Use it for all IIO accelerometer drivers.Signed-off-by Jonathan Cameron <[email protected]>---
I debated whether to split this up by driver by the time we've done all IIO drivers that will be a very large number of trivial patches.
The changes are minor enough that they shouldn't present much of a backporting challenge if needed for future fixes etc.
Quoted 7 lines
I'm find splitting them up if people prefer.
Next on my list is to look at adding runtime checks that the buffers containing these timestamps are big enough but I want this out of the way first.Cc Andy Shevchenko <[email protected]>---
LGTM,
Reviewed-by; Nuno Sa <[email protected]>
Quoted 298 lines
drivers/iio/accel/bma180.c | 3 ++-
drivers/iio/accel/bma220_spi.c | 1 +
drivers/iio/accel/bma400_core.c | 2 +-
drivers/iio/accel/bmc150-accel.h | 3 ++-
drivers/iio/accel/fxls8962af-core.c | 3 ++-
drivers/iio/accel/kionix-kx022a.c | 3 ++-
drivers/iio/accel/kxcjk-1013.c | 3 ++-
drivers/iio/accel/kxsd9.c | 3 ++-
drivers/iio/accel/mma7455_core.c | 3 ++-
drivers/iio/accel/mma8452.c | 3 ++-
drivers/iio/accel/msa311.c | 3 ++-
drivers/iio/accel/mxc4005.c | 3 ++-
drivers/iio/accel/stk8312.c | 3 ++-
drivers/iio/accel/stk8ba50.c | 3 ++-14 files changed, 26 insertions(+), 13 deletions(-)drivers/iio/accel/bma180.c +2
-1@@ -21,6 +21,7 @@ #include <linux/regulator/consumer.h> #include <linux/slab.h> #include <linux/string.h> +#include <linux/types.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h> #include <linux/iio/buffer.h>@@ -144,7 +145,7 @@ struct bma180_data { /* Ensure timestamp is naturally aligned */ struct { s16 chan[4]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan; };drivers/iio/accel/bma220_spi.c +1
-0@@ -9,6 +9,7 @@ #include <linux/kernel.h> #include <linux/mod_devicetable.h> #include <linux/module.h> +#include <linux/types.h> #include <linux/spi/spi.h>
#include <linux/iio/buffer.h>drivers/iio/accel/bma400_core.c +1
-1@@ -115,7 +115,7 @@ struct bma400_data { struct { __le16 buff[3]; u8 temperature; -s64 ts__aligned(8) ; +aligned_s64 ts; } buffer __aligned(IIO_DMA_MINALIGN); __le16 status; __be16 duration;drivers/iio/accel/bmc150- renamed from drivers/iio/accel/bmc150-accel.h +0
-0
accel.h
index7775c5edaeef..7a7baf52e595100644drivers/iio/accel/bmc150-accel.h +1
-0@@ -6,6 +6,7 @@ #include <linux/iio/iio.h> #include <linux/mutex.h> #include <linux/regulator/consumer.h> +#include <linux/types.h> #include <linux/workqueue.h>
struct regmap;drivers/iio/accel/bmc150-accel.h +1
-1@@ -69,7 +70,7 @@ struct bmc150_accel_data {*/ struct { __le16 channels[3]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan; u8 bw_bits; u32 slope_dur;drivers/iio/accel/fxls8962af-core.c +1
-0@@ -22,6 +22,7 @@ #include <linux/property.h> #include <linux/regulator/consumer.h> #include <linux/regmap.h> +#include <linux/types.h>
#include <linux/iio/buffer.h>
#include <linux/iio/events.h>drivers/iio/accel/fxls8962af-core.c +1
-1@@ -163,7 +164,7 @@ struct fxls8962af_data { const struct fxls8962af_chip_info *chip_info; struct { __le16 channels[3]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan;
int64_ttimestamp,old_timestamp; /* Only used in hw fifo mode.
*/
structiio_mount_matrixorientation;drivers/iio/accel/kionix- renamed from drivers/iio/accel/kionix-kx022a.c +0
-0
kx022a.c
index53d59a04ae15..32387819995d100644drivers/iio/accel/kionix-kx022a.c +1
-0@@ -16,6 +16,7 @@ #include <linux/regulator/consumer.h> #include <linux/slab.h> #include <linux/string_choices.h> +#include <linux/types.h> #include <linux/units.h>
#include <linux/iio/iio.h>drivers/iio/accel/kionix-kx022a.c +1
-1@@ -292,7 +293,7 @@ struct kx022a_data { __le16 buffer[8] __aligned(IIO_DMA_MINALIGN); struct { __le16 channels[3]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan; };drivers/iio/accel/kxcjk-1013.c +2
-1@@ -11,6 +11,7 @@ #include <linux/bitops.h> #include <linux/slab.h> #include <linux/string.h> +#include <linux/types.h> #include <linux/acpi.h> #include <linux/pm.h> #include <linux/pm_runtime.h>@@ -250,7 +251,7 @@ struct kxcjk1013_data { /* Ensure timestamp naturally aligned */ struct { s16 chans[AXIS_MAX]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan; u8 odr_bits; u8 range;drivers/iio/accel/kxsd9.c +2
-1@@ -15,6 +15,7 @@ #include <linux/kernel.h> #include <linux/sysfs.h> #include <linux/slab.h> +#include <linux/types.h> #include <linux/module.h> #include <linux/regmap.h> #include <linux/bitops.h>@@ -215,7 +216,7 @@ static irqreturn_t kxsd9_trigger_handler(int irq, void *p)*/ struct { __be16 chan[4]; -s64 ts__aligned(8) ; +aligned_s64 ts; } hw_values; int ret;drivers/iio/accel/mma7455_core.c +1
-0@@ -19,6 +19,7 @@ #include <linux/iio/triggered_buffer.h> #include <linux/module.h> #include <linux/regmap.h> +#include <linux/types.h>
#include "mma7455.h"drivers/iio/accel/mma7455_core.c +1
-1@@ -58,7 +59,7 @@ struct mma7455_data {*/ struct { __le16 channels[3]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan; };drivers/iio/accel/mma8452.c +1
-0@@ -32,6 +32,7 @@ #include <linux/delay.h> #include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> +#include <linux/types.h>
#defineMMA8452_STATUS0x00
#defineMMA8452_STATUS_DRDY(BIT(2) | BIT(1) | BIT(0))drivers/iio/accel/mma8452.c +1
-1@@ -115,7 +116,7 @@ struct mma8452_data { /* Ensure correct alignment of time stamp when present */ struct { __be16 channels[3]; -s64 ts__aligned(8) ; +aligned_s64 ts; } buffer; };drivers/iio/accel/msa311.c +1
-0@@ -34,6 +34,7 @@ #include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/string_choices.h> +#include <linux/types.h> #include <linux/units.h>
#include <linux/iio/buffer.h>drivers/iio/accel/msa311.c +1
-1@@ -893,7 +894,7 @@ static irqreturn_t msa311_buffer_thread(int irq, void *p) __le16 axis; struct { __le16 channels[MSA311_SI_Z + 1]; -s64 ts__aligned(8) ; +aligned_s64 ts; } buf;
memset(&buf, 0, sizeof(buf));drivers/iio/accel/mxc4005.c +2
-1@@ -11,6 +11,7 @@ #include <linux/iio/iio.h> #include <linux/mod_devicetable.h> #include <linux/regmap.h> +#include <linux/types.h> #include <linux/iio/sysfs.h> #include <linux/iio/trigger.h> #include <linux/iio/buffer.h>@@ -69,7 +70,7 @@ struct mxc4005_data { /* Ensure timestamp is naturally aligned */ struct { __be16 chans[3]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan; bool trigger_enabled; unsigned int control;drivers/iio/accel/stk8312.c +2
-1@@ -12,6 +12,7 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/delay.h> +#include <linux/types.h> #include <linux/iio/buffer.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h>@@ -105,7 +106,7 @@ struct stk8312_data { /* Ensure timestamp is naturally aligned */ struct { s8 chans[3]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan; };drivers/iio/accel/stk8ba50.c +2
-1@@ -12,6 +12,7 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/mod_devicetable.h> +#include <linux/types.h> #include <linux/iio/buffer.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h>@@ -94,7 +95,7 @@ struct stk8ba50_data { /* Ensure timestamp is naturally aligned */ struct { s16 chans[3]; -s64 timetamp__aligned(8) ; +aligned_s64 timetamp; } scan; };
Quoted 9 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
e4ca0e59c394("types: Complement the aligned types with signed 64-bit one") introducedaligned_s64. Use it for all IIO accelerometer drivers.Signed-off-by Jonathan Cameron <[email protected]>---
Giving a proper tag this time :)
Quoted 311 lines
I debated whether to split this up by driver by the time we've done all IIO drivers that will be a very large number of trivial patches.
The changes are minor enough that they shouldn't present much of a backporting challenge if needed for future fixes etc.
I'm find splitting them up if people prefer.
Next on my list is to look at adding runtime checks that the buffers containing these timestamps are big enough but I want this out of the way first.Cc Andy Shevchenko <[email protected]>---
drivers/iio/accel/bma180.c | 3 ++-
drivers/iio/accel/bma220_spi.c | 1 +
drivers/iio/accel/bma400_core.c | 2 +-
drivers/iio/accel/bmc150-accel.h | 3 ++-
drivers/iio/accel/fxls8962af-core.c | 3 ++-
drivers/iio/accel/kionix-kx022a.c | 3 ++-
drivers/iio/accel/kxcjk-1013.c | 3 ++-
drivers/iio/accel/kxsd9.c | 3 ++-
drivers/iio/accel/mma7455_core.c | 3 ++-
drivers/iio/accel/mma8452.c | 3 ++-
drivers/iio/accel/msa311.c | 3 ++-
drivers/iio/accel/mxc4005.c | 3 ++-
drivers/iio/accel/stk8312.c | 3 ++-
drivers/iio/accel/stk8ba50.c | 3 ++-14 files changed, 26 insertions(+), 13 deletions(-)drivers/iio/accel/bma180.c +2
-1@@ -21,6 +21,7 @@ #include <linux/regulator/consumer.h> #include <linux/slab.h> #include <linux/string.h> +#include <linux/types.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h> #include <linux/iio/buffer.h>@@ -144,7 +145,7 @@ struct bma180_data { /* Ensure timestamp is naturally aligned */ struct { s16 chan[4]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan; };drivers/iio/accel/bma220_spi.c +1
-0@@ -9,6 +9,7 @@ #include <linux/kernel.h> #include <linux/mod_devicetable.h> #include <linux/module.h> +#include <linux/types.h> #include <linux/spi/spi.h>
#include <linux/iio/buffer.h>drivers/iio/accel/bma400_core.c +1
-1@@ -115,7 +115,7 @@ struct bma400_data { struct { __le16 buff[3]; u8 temperature; -s64 ts__aligned(8) ; +aligned_s64 ts; } buffer __aligned(IIO_DMA_MINALIGN); __le16 status; __be16 duration;drivers/iio/accel/bmc150- renamed from drivers/iio/accel/bmc150-accel.h +0
-0
accel.h
index7775c5edaeef..7a7baf52e595100644drivers/iio/accel/bmc150-accel.h +1
-0@@ -6,6 +6,7 @@ #include <linux/iio/iio.h> #include <linux/mutex.h> #include <linux/regulator/consumer.h> +#include <linux/types.h> #include <linux/workqueue.h>
struct regmap;drivers/iio/accel/bmc150-accel.h +1
-1@@ -69,7 +70,7 @@ struct bmc150_accel_data {*/ struct { __le16 channels[3]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan; u8 bw_bits; u32 slope_dur;drivers/iio/accel/fxls8962af-core.c +1
-0@@ -22,6 +22,7 @@ #include <linux/property.h> #include <linux/regulator/consumer.h> #include <linux/regmap.h> +#include <linux/types.h>
#include <linux/iio/buffer.h>
#include <linux/iio/events.h>drivers/iio/accel/fxls8962af-core.c +1
-1@@ -163,7 +164,7 @@ struct fxls8962af_data { const struct fxls8962af_chip_info *chip_info; struct { __le16 channels[3]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan;
int64_ttimestamp,old_timestamp; /* Only used in hw fifo mode.
*/
structiio_mount_matrixorientation;drivers/iio/accel/kionix- renamed from drivers/iio/accel/kionix-kx022a.c +0
-0
kx022a.c
index53d59a04ae15..32387819995d100644drivers/iio/accel/kionix-kx022a.c +1
-0@@ -16,6 +16,7 @@ #include <linux/regulator/consumer.h> #include <linux/slab.h> #include <linux/string_choices.h> +#include <linux/types.h> #include <linux/units.h>
#include <linux/iio/iio.h>drivers/iio/accel/kionix-kx022a.c +1
-1@@ -292,7 +293,7 @@ struct kx022a_data { __le16 buffer[8] __aligned(IIO_DMA_MINALIGN); struct { __le16 channels[3]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan; };drivers/iio/accel/kxcjk-1013.c +2
-1@@ -11,6 +11,7 @@ #include <linux/bitops.h> #include <linux/slab.h> #include <linux/string.h> +#include <linux/types.h> #include <linux/acpi.h> #include <linux/pm.h> #include <linux/pm_runtime.h>@@ -250,7 +251,7 @@ struct kxcjk1013_data { /* Ensure timestamp naturally aligned */ struct { s16 chans[AXIS_MAX]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan; u8 odr_bits; u8 range;drivers/iio/accel/kxsd9.c +2
-1@@ -15,6 +15,7 @@ #include <linux/kernel.h> #include <linux/sysfs.h> #include <linux/slab.h> +#include <linux/types.h> #include <linux/module.h> #include <linux/regmap.h> #include <linux/bitops.h>@@ -215,7 +216,7 @@ static irqreturn_t kxsd9_trigger_handler(int irq, void *p)*/ struct { __be16 chan[4]; -s64 ts__aligned(8) ; +aligned_s64 ts; } hw_values; int ret;drivers/iio/accel/mma7455_core.c +1
-0@@ -19,6 +19,7 @@ #include <linux/iio/triggered_buffer.h> #include <linux/module.h> #include <linux/regmap.h> +#include <linux/types.h>
#include "mma7455.h"drivers/iio/accel/mma7455_core.c +1
-1@@ -58,7 +59,7 @@ struct mma7455_data {*/ struct { __le16 channels[3]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan; };drivers/iio/accel/mma8452.c +1
-0@@ -32,6 +32,7 @@ #include <linux/delay.h> #include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> +#include <linux/types.h>
#defineMMA8452_STATUS0x00
#defineMMA8452_STATUS_DRDY(BIT(2) | BIT(1) | BIT(0))drivers/iio/accel/mma8452.c +1
-1@@ -115,7 +116,7 @@ struct mma8452_data { /* Ensure correct alignment of time stamp when present */ struct { __be16 channels[3]; -s64 ts__aligned(8) ; +aligned_s64 ts; } buffer; };drivers/iio/accel/msa311.c +1
-0@@ -34,6 +34,7 @@ #include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/string_choices.h> +#include <linux/types.h> #include <linux/units.h>
#include <linux/iio/buffer.h>drivers/iio/accel/msa311.c +1
-1@@ -893,7 +894,7 @@ static irqreturn_t msa311_buffer_thread(int irq, void *p) __le16 axis; struct { __le16 channels[MSA311_SI_Z + 1]; -s64 ts__aligned(8) ; +aligned_s64 ts; } buf;
memset(&buf, 0, sizeof(buf));drivers/iio/accel/mxc4005.c +2
-1@@ -11,6 +11,7 @@ #include <linux/iio/iio.h> #include <linux/mod_devicetable.h> #include <linux/regmap.h> +#include <linux/types.h> #include <linux/iio/sysfs.h> #include <linux/iio/trigger.h> #include <linux/iio/buffer.h>@@ -69,7 +70,7 @@ struct mxc4005_data { /* Ensure timestamp is naturally aligned */ struct { __be16 chans[3]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan; bool trigger_enabled; unsigned int control;drivers/iio/accel/stk8312.c +2
-1@@ -12,6 +12,7 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/delay.h> +#include <linux/types.h> #include <linux/iio/buffer.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h>@@ -105,7 +106,7 @@ struct stk8312_data { /* Ensure timestamp is naturally aligned */ struct { s8 chans[3]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan; };drivers/iio/accel/stk8ba50.c +2
-1@@ -12,6 +12,7 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/mod_devicetable.h> +#include <linux/types.h> #include <linux/iio/buffer.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h>@@ -94,7 +95,7 @@ struct stk8ba50_data { /* Ensure timestamp is naturally aligned */ struct { s16 chans[3]; -s64 timetamp__aligned(8) ; +aligned_s64 timetamp; } scan; };
Quoted 6 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
e4ca0e59c394("types: Complement the aligned types with signed 64-bit one") introducedaligned_s64. Use it for all IIO accelerometer drivers.Signed-off-by Jonathan Cameron <[email protected]>
Quoted 313 lines
---
I debated whether to split this up by driver by the time we've done all IIO drivers that will be a very large number of trivial patches.
The changes are minor enough that they shouldn't present much of a backporting challenge if needed for future fixes etc.
I'm find splitting them up if people prefer.
Next on my list is to look at adding runtime checks that the buffers containing these timestamps are big enough but I want this out of the way first.Cc Andy Shevchenko <[email protected]>--- drivers/iio/accel/bma180.c | 3 ++- drivers/iio/accel/bma220_spi.c | 1 + drivers/iio/accel/bma400_core.c | 2 +- drivers/iio/accel/bmc150-accel.h | 3 ++- drivers/iio/accel/fxls8962af-core.c | 3 ++- drivers/iio/accel/kionix-kx022a.c | 3 ++- drivers/iio/accel/kxcjk-1013.c | 3 ++- drivers/iio/accel/kxsd9.c | 3 ++- drivers/iio/accel/mma7455_core.c | 3 ++- drivers/iio/accel/mma8452.c | 3 ++- drivers/iio/accel/msa311.c | 3 ++- drivers/iio/accel/mxc4005.c | 3 ++- drivers/iio/accel/stk8312.c | 3 ++- drivers/iio/accel/stk8ba50.c | 3 ++- 14 files changed, 26 insertions(+), 13 deletions(-)drivers/iio/accel/bma180.c +2
-1@@ -21,6 +21,7 @@#include <linux/regulator/consumer.h> #include <linux/slab.h> #include <linux/string.h> +#include <linux/types.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h> #include <linux/iio/buffer.h> @@ -144,7 +145,7 @@ struct bma180_data {/* Ensure timestamp is naturally aligned */ struct {s16 chan[4 ]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan; };drivers/iio/accel/bma220_spi.c +1
-0@@ -9,6 +9,7 @@#include <linux/kernel.h> #include <linux/mod_devicetable.h> #include <linux/module.h> +#include <linux/types.h> #include <linux/spi/spi.h> #include <linux/iio/buffer.h> drivers/iio/accel/bma400_core.c +1
-1@@ -115,7 +115,7 @@ struct bma400_data {struct {__le16 buff[3 ];u8 temperature; -s64 ts__aligned(8) ; +aligned_s64 ts; } buffer__aligned(IIO_DMA_MINALIGN) ;__le16 status;__be16 duration;drivers/iio/accel/bmc150-accel.h +2
-1@@ -6,6 +6,7 @@#include <linux/iio/iio.h> #include <linux/mutex.h> #include <linux/regulator/consumer.h> +#include <linux/types.h> #include <linux/workqueue.h> struct regmap ;@@ -69,7 +70,7 @@ struct bmc150_accel_data {*/ struct {__le16 channels[3 ]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan;u8 bw_bits;u32 slope_dur;drivers/iio/accel/fxls8962af-core.c +2
-1@@ -22,6 +22,7 @@#include <linux/property.h> #include <linux/regulator/consumer.h> #include <linux/regmap.h> +#include <linux/types.h> #include <linux/iio/buffer.h> #include <linux/iio/events.h> @@ -163,7 +164,7 @@ struct fxls8962af_data {const struct fxls8962af_chip_info *chip_info;struct {__le16 channels[3 ]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan;int64_t timestamp, old_timestamp;/* Only used in hw fifo mode. */ struct iio_mount_matrix orientation;drivers/iio/accel/kionix-kx022a.c +2
-1@@ -16,6 +16,7 @@#include <linux/regulator/consumer.h> #include <linux/slab.h> #include <linux/string_choices.h> +#include <linux/types.h> #include <linux/units.h> #include <linux/iio/iio.h> @@ -292,7 +293,7 @@ struct kx022a_data {__le16 buffer[8 ]__aligned(IIO_DMA_MINALIGN) ;struct {__le16 channels[3 ]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan; };drivers/iio/accel/kxcjk-1013.c +2
-1@@ -11,6 +11,7 @@#include <linux/bitops.h> #include <linux/slab.h> #include <linux/string.h> +#include <linux/types.h> #include <linux/acpi.h> #include <linux/pm.h> #include <linux/pm_runtime.h> @@ -250,7 +251,7 @@ struct kxcjk1013_data {/* Ensure timestamp naturally aligned */ struct {s16 chans[AXIS_MAX ]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan;u8 odr_bits;u8 range;drivers/iio/accel/kxsd9.c +2
-1@@ -15,6 +15,7 @@#include <linux/kernel.h> #include <linux/sysfs.h> #include <linux/slab.h> +#include <linux/types.h> #include <linux/module.h> #include <linux/regmap.h> #include <linux/bitops.h> @@ -215,7 +216,7 @@ static irqreturn_t kxsd9_trigger_handler(int irq, void *p)*/ struct {__be16 chan[4 ]; -s64 ts__aligned(8) ; +aligned_s64 ts; } hw_values;int ret;drivers/iio/accel/mma7455_core.c +2
-1@@ -19,6 +19,7 @@#include <linux/iio/triggered_buffer.h> #include <linux/module.h> #include <linux/regmap.h> +#include <linux/types.h> #include "mma7455.h" @@ -58,7 +59,7 @@ struct mma7455_data {*/ struct {__le16 channels[3 ]; -s64 ts__aligned(8) ; +aligned_s64 ts; } scan; };drivers/iio/accel/mma8452.c +2
-1@@ -32,6 +32,7 @@#include <linux/delay.h> #include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> +#include <linux/types.h> #define MMA8452_STATUS 0x00#define MMA8452_STATUS_DRDY (BIT(2) | BIT(1) | BIT(0))@@ -115,7 +116,7 @@ struct mma8452_data {/* Ensure correct alignment of time stamp when present */ struct {__be16 channels[3 ]; -s64 ts__aligned(8) ; +aligned_s64 ts; } buffer; };drivers/iio/accel/msa311.c +2
-1@@ -34,6 +34,7 @@#include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/string_choices.h> +#include <linux/types.h> #include <linux/units.h> #include <linux/iio/buffer.h> @@ -893,7 +894,7 @@ static irqreturn_t msa311_buffer_thread(int irq, void *p)__le16 axis;struct {__le16 channels[MSA311_SI_Z +1 ]; -s64 ts__aligned(8) ; +aligned_s64 ts; } buf;memset (&buf,0 ,sizeof (buf));drivers/iio/accel/mxc4005.c +2
-1@@ -11,6 +11,7 @@#include <linux/iio/iio.h> #include <linux/mod_devicetable.h> #include <linux/regmap.h> +#include <linux/types.h> #include <linux/iio/sysfs.h> #include <linux/iio/trigger.h> #include <linux/iio/buffer.h> @@ -69,7 +70,7 @@ struct mxc4005_data {/* Ensure timestamp is naturally aligned */ struct {__be16 chans[3 ]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan;bool trigger_enabled;unsigned int control;drivers/iio/accel/stk8312.c +2
-1@@ -12,6 +12,7 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/delay.h> +#include <linux/types.h> #include <linux/iio/buffer.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h> @@ -105,7 +106,7 @@ struct stk8312_data {/* Ensure timestamp is naturally aligned */ struct {s8 chans[3 ]; -s64 timestamp__aligned(8) ; +aligned_s64 timestamp; } scan; };drivers/iio/accel/stk8ba50.c +2
-1@@ -12,6 +12,7 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/mod_devicetable.h> +#include <linux/types.h> #include <linux/iio/buffer.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h> @@ -94,7 +95,7 @@ struct stk8ba50_data {/* Ensure timestamp is naturally aligned */ struct {s16 chans[3 ]; -s64 timetamp__aligned(8) ; +aligned_s64 timetamp; } scan; };Signature · 1 line
2.46.2
Signature · 2 lines
Thank you, Dmitry