[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VcTasNFyx99x4nPaRsjZtp8mEMBOw08e4RfFnsmXx-4SQ@mail.gmail.com>
Date: Thu, 28 Nov 2024 08:40:45 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: David Lechner <dlechner@...libre.com>
Cc: Jonathan Cameron <jic23@...nel.org>, Dumitru Ceclan <mitrutzceclan@...il.com>,
Michael Hennerich <Michael.Hennerich@...log.com>, Nuno Sa <nuno.sa@...log.com>,
Michael Walle <michael@...le.cc>, Andy Shevchenko <andy@...nel.org>, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org,
Uwe Kleine-König <u.kleine-koenig@...libre.com>,
Guillaume Ranquet <granquet@...libre.com>
Subject: Re: [PATCH v2 3/3] iio: adc: ad7173: don't make copy of
ad_sigma_delta_info struct
On Wed, Nov 27, 2024 at 10:02 PM David Lechner <dlechner@...libre.com> 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
Powered by blists - more mailing lists