]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: dibx000_common: Constify struct i2c_algorithm
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 8 Sep 2024 08:21:00 +0000 (10:21 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Fri, 21 Feb 2025 09:33:10 +0000 (10:33 +0100)
commit4f527a0463fd6e796e6d1722b8c6b995bccfa4a5
treef917528c6cdbe3f051b5ab2f633327300f5945eb
parent5efde2811c1cc51228f2cded7ad2ab1e062026f3
media: dibx000_common: Constify struct i2c_algorithm

'struct i2c_algorithm' is not modified in this driver.

Constifying this structure moves some data to a read-only section, so
increase overall security, especially when the structure holds some
function pointers.

To do so, the prototype of i2c_adapter_init() has to be updated as well.

On a x86_64, with allmodconfig:
Before:
======
   text    data     bss     dec     hex filename
  17213     932      20   18165    46f5 drivers/media/dvb-frontends/dibx000_common.o

After:
=====
   text    data     bss     dec     hex filename
  17490     660      20   18170    46fa drivers/media/dvb-frontends/dibx000_common.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/dvb-frontends/dibx000_common.c