Re: [PATCH v2 3/3] iio: accel: mma8452: Optimize struct mm8452_data member orders

From: Joshua Crofts

Date: Wed Jul 15 2026 - 09:18:23 EST


On Wed, 15 Jul 2026 14:33:29 +0200
Esben Haabendal <esben@xxxxxxxxxx> wrote:

> Reorder struct mma8452_data members to avoid holes.
>
> Signed-off-by: Esben Haabendal <esben@xxxxxxxxxx>
> ---
> drivers/iio/accel/mma8452.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
> index fdf7364d7fed..537263085215 100644
> --- a/drivers/iio/accel/mma8452.c
> +++ b/drivers/iio/accel/mma8452.c
> @@ -108,11 +108,7 @@ struct mma8452_data {
> struct i2c_client *client;
> struct mutex lock;
> struct iio_mount_matrix orientation;
> - u8 ctrl_reg1;
> - u8 data_cfg;
> - bool open_drain;
> const struct mma_chip_info *chip_info;
> - int sleep_val;
> struct regulator *vdd_reg;
> struct regulator *vddio_reg;
>
> @@ -121,6 +117,11 @@ struct mma8452_data {
> __be16 channels[3];
> aligned_s64 ts;
> } buffer;
> +
> + int sleep_val;
> + u8 ctrl_reg1;
> + u8 data_cfg;
> + bool open_drain;
> };

Also quick thing, in order to prevent too much cruft, could you
please move this patch before patch 2? You introduce the bool in
2 and then move it to the end in 3, better for you to reorder it
first and add the bool after, otherwise you get these "ping-pong"
style changes (Andy's words). My reviewed-by still stands either way,
so feel free to add it once reordered.

--
Kind regards

CJD