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

soc: ti: knav_qmss: Constify struct knav_range_ops

'struct knav_range_ops' is not modified in these drivers.

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

On a x86_64, with allmodconfig:
Before:
======
text data bss dec hex filename
7498 1193 0 8691 21f3 drivers/soc/ti/knav_qmss_acc.o

After:
=====
text data bss dec hex filename
7566 1145 0 8711 2207 drivers/soc/ti/knav_qmss_acc.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/a8b4b428f97fc584f38bf45100aa9da241aeb935.1719159074.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Nishanth Menon <nm@ti.com>

authored by

Christophe JAILLET and committed by
Nishanth Menon
ca16cb2b f1de10ae

+3 -3
+1 -1
drivers/soc/ti/knav_qmss.h
··· 333 333 void *queue_base_inst; 334 334 unsigned flags; 335 335 struct list_head list; 336 - struct knav_range_ops *ops; 336 + const struct knav_range_ops *ops; 337 337 struct knav_acc_info acc_info; 338 338 struct knav_acc_channel *acc; 339 339 unsigned num_irqs;
+1 -1
drivers/soc/ti/knav_qmss_acc.c
··· 450 450 return 0; 451 451 } 452 452 453 - static struct knav_range_ops knav_acc_range_ops = { 453 + static const struct knav_range_ops knav_acc_range_ops = { 454 454 .set_notify = knav_acc_set_notify, 455 455 .init_queue = knav_acc_init_queue, 456 456 .open_queue = knav_acc_open_queue,
+1 -1
drivers/soc/ti/knav_qmss_queue.c
··· 411 411 return 0; 412 412 } 413 413 414 - static struct knav_range_ops knav_gp_range_ops = { 414 + static const struct knav_range_ops knav_gp_range_ops = { 415 415 .set_notify = knav_gp_set_notify, 416 416 .open_queue = knav_gp_open_queue, 417 417 .close_queue = knav_gp_close_queue,