Re: [PATCH 1/2] iio: adc: Constify struct iio_map

From: Christophe JAILLET
Date: Sun Sep 08 2024 - 07:44:51 EST


Le 08/09/2024 à 12:45, Jonathan Cameron a écrit :
On Sat, 7 Sep 2024 19:24:46 +0200
Christophe JAILLET <christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@xxxxxxxxxxxxxxxx> wrote:

'struct iio_map' are not modified in these drivers.

Constifying this structure moves some data to a read-only section, so
increase overall security.

In order to do it, the prototype of iio_map_array_register() and
devm_iio_map_array_register(), and a few structures that hold a
"struct iio_map *" need to be adjusted.

On a x86_64, with allmodconfig, as an example:
Before:
======
text data bss dec hex filename
21086 760 0 21846 5556 drivers/iio/adc/axp20x_adc.o

After:
=====
text data bss dec hex filename
21470 360 0 21830 5546 drivers/iio/adc/axp20x_adc.o
33842 1697 384 35923 8c53 drivers/iio/addac/ad74413r.o
Cropping was a bit random, given before and after have different files.

Argh, the 2nd line related to ad74413r.o should be removed. Only the 1st one is relevant.

Sorry about that.


Anyhow, doesn't matter much, so applied as is.
Note this is 6.13 material now.

Thanks,

Thanks,

CJ


Jonathan