Re: [PATCH v2 3/3] iio: adc: ad7173: don't make copy of ad_sigma_delta_info struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 27, 2024 at 10:02 PM David Lechner <dlechner@xxxxxxxxxxxx> wrote:
>
> Use two separate static const struct ad_sigma_delta_info instances
> instead of making a copy for each driver instance.
>
> Typically in the IIO subsystem, we use multiple static const instances
> of the same struct when there are different variants of the same family
> of devices as opposed to making a copy for each driver instance and
> modifying it.

...

> Whether this patch is an improvement or not is debatable. It makes
> things a bit more verbose, but to me it seems more consistent with
> how such cases are handled in the IIO subsystem. So take this one or
> leave it.

Constifications are always an improvement. This makes the related
pieces of data to be moved to rodata sections and hence have proper
page flag settings at runtime avoiding any modifications of the data
which might be used for ROP gadgets or something like that in some
cases.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux