mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] drm/i2c: tda9950: Constify struct i2c_device_id
@ 2024-11-15 17:17 Christophe JAILLET
  2024-11-19  9:58 ` Thomas Zimmermann
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2024-11-15 17:17 UTC (permalink / raw)
  To: linux, broonie, lee, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, dri-devel

'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
  12136	    822	      0	  12958	   329e	drivers/gpu/drm/i2c/tda9950.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  12200	    758	      0	  12958	   329e	drivers/gpu/drm/i2c/tda9950.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile tested-only.

v2: fix missing const :(
---
 drivers/gpu/drm/i2c/tda9950.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i2c/tda9950.c b/drivers/gpu/drm/i2c/tda9950.c
index 82d618c40dce..5065d6212fe4 100644
--- a/drivers/gpu/drm/i2c/tda9950.c
+++ b/drivers/gpu/drm/i2c/tda9950.c
@@ -485,7 +485,7 @@ static void tda9950_remove(struct i2c_client *client)
 	cec_unregister_adapter(priv->adap);
 }
 
-static struct i2c_device_id tda9950_ids[] = {
+static const struct i2c_device_id tda9950_ids[] = {
 	{ "tda9950", 0 },
 	{ },
 };
-- 
2.47.0


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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-15 17:17 [PATCH v2] drm/i2c: tda9950: Constify struct i2c_device_id Christophe JAILLET
2024-11-19  9:58 ` Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®