Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: proximity: aw96103: Constify struct iio_info​

'struct iio_info' 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.

On a x86_64, with allmodconfig:
Before:
======
text data bss dec hex filename
17366 1454 16 18836 4994 drivers/iio/proximity/aw96103.o

After:
=====
text data bss dec hex filename
17526 1294 16 18836 4994 drivers/iio/proximity/aw96103.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/da4918af46fef03903ab0e9fdcb4f23e014f3821.1733522812.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Christophe JAILLET and committed by
Jonathan Cameron
56f8c175 582d732b

+1 -1
+1 -1
drivers/iio/proximity/aw96103.c
··· 433 433 state ? BIT(chan->channel) : 0); 434 434 } 435 435 436 - static struct iio_info iio_info = { 436 + static const struct iio_info iio_info = { 437 437 .read_raw = aw96103_read_raw, 438 438 .read_event_value = aw96103_read_event_val, 439 439 .write_event_value = aw96103_write_event_val,