All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Input: cypress-sf - Constify struct i2c_device_id
@ 2024-11-15 16:50 Christophe JAILLET
  2024-11-19  3:35 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2024-11-15 16:50 UTC (permalink / raw)
  To: Yassine Oudjana, Dmitry Torokhov
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-input

'struct i2c_device_id' is not modified in this driver.

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
   6438	    618	      0	   7056	   1b90	drivers/input/keyboard/cypress-sf.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
   6502	    554	      0	   7056	   1b90	drivers/input/keyboard/cypress-sf.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile tested-only.
---
 drivers/input/keyboard/cypress-sf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/cypress-sf.c b/drivers/input/keyboard/cypress-sf.c
index eb1d0720784d..335b72efc5aa 100644
--- a/drivers/input/keyboard/cypress-sf.c
+++ b/drivers/input/keyboard/cypress-sf.c
@@ -208,7 +208,7 @@ static int cypress_sf_resume(struct device *dev)
 static DEFINE_SIMPLE_DEV_PM_OPS(cypress_sf_pm_ops,
 				cypress_sf_suspend, cypress_sf_resume);
 
-static struct i2c_device_id cypress_sf_id_table[] = {
+static const struct i2c_device_id cypress_sf_id_table[] = {
 	{ CYPRESS_SF_DEV_NAME },
 	{ }
 };
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-19  3:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-15 16:50 [PATCH] Input: cypress-sf - Constify struct i2c_device_id Christophe JAILLET
2024-11-19  3:35 ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.