]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: adc: Constify struct iio_map
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 7 Sep 2024 17:24:46 +0000 (19:24 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 30 Sep 2024 08:21:02 +0000 (09:21 +0100)
commitfaf178607772f28006e403d7bab6c4217d4ee447
tree18237e07d024c372805d2bfe6b86d32b19622f53
parent482447fd6f20b9b04a36e0555f67d646be875392
iio: adc: Constify struct iio_map

'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

--
Compile tested only

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/5729dc3cc3892ecf0d8ea28c5f7307b34e27493e.1725729801.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/axp20x_adc.c
drivers/iio/adc/axp288_adc.c
drivers/iio/adc/da9150-gpadc.c
drivers/iio/adc/intel_mrfld_adc.c
drivers/iio/adc/lp8788_adc.c
drivers/iio/adc/mp2629_adc.c
drivers/iio/adc/rn5t618-adc.c
drivers/iio/adc/sun4i-gpadc-iio.c
drivers/iio/inkern.c
include/linux/iio/driver.h