Re: [PATCH v5 1/5] iio: ssp_sensors: cleanup codestyle warning

From: Andy Shevchenko

Date: Tue Apr 07 2026 - 15:32:27 EST


On Tue, Apr 07, 2026 at 11:12:25PM +0530, Sanjay Chitroda wrote:
> On 7 April 2026 12:03:39 am IST, Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> >On Mon, Apr 06, 2026 at 01:38:48PM +0530, Sanjay Chitroda wrote:

> >> Reported by checkpatch:
> >> FILE: drivers/iio/common/ssp_sensors/ssp_spi.c
> >>
> >> WARNING: Prefer __packed over __attribute__((__packed__))
> >> +} __attribute__((__packed__));
> >
> >Do we need __packed to be there in the first place? Isn't it naturally aligned?
>
> This structure isn't naturally aligned as in header structure u8 is followed
> by __le16 and __le32 fields. Without packing, compiler inserts padding to
> satisfy alignment requirement.

Thank you for confirming this.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>

--
With Best Regards,
Andy Shevchenko