drm/bridge: Constify struct i2c_device_id
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 12 Nov 2024 21:12:25 +0000 (22:12 +0100)
committerDouglas Anderson <dianders@chromium.org>
Wed, 20 Nov 2024 23:14:43 +0000 (15:14 -0800)
'struct i2c_device_id' 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, as an example:
Before:
======
   text    data     bss     dec     hex filename
  15566     987      32   16585    40c9 drivers/gpu/drm/bridge/chipone-icn6211.o

After:
=====
   text    data     bss     dec     hex filename
  15630     923      32   16585    40c9 drivers/gpu/drm/bridge/chipone-icn6211.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/bdba1f49b4b48e22628482b49ce81f8e1f0d97b1.1731445901.git.christophe.jaillet@wanadoo.fr
drivers/gpu/drm/bridge/chipone-icn6211.c
drivers/gpu/drm/bridge/lontium-lt9211.c
drivers/gpu/drm/bridge/lontium-lt9611.c
drivers/gpu/drm/bridge/lontium-lt9611uxc.c
drivers/gpu/drm/bridge/ti-sn65dsi83.c
drivers/gpu/drm/bridge/ti-sn65dsi86.c

index 9eecac457dcf5e8385f5d8e2e94c2b6b562ccb63..d47703559b0dec13fa4478d90ca29be2e899637a 100644 (file)
@@ -785,7 +785,7 @@ static struct mipi_dsi_driver chipone_dsi_driver = {
        },
 };
 
-static struct i2c_device_id chipone_i2c_id[] = {
+static const struct i2c_device_id chipone_i2c_id[] = {
        { "chipone,icn6211" },
        {},
 };
index c8881796fba4c6a4dddebd2a266a0c3c30825e0b..999ddebb832de1a3e4a4174c3d5d4cfb3bfcee74 100644 (file)
@@ -773,7 +773,7 @@ static void lt9211_remove(struct i2c_client *client)
        drm_bridge_remove(&ctx->bridge);
 }
 
-static struct i2c_device_id lt9211_id[] = {
+static const struct i2c_device_id lt9211_id[] = {
        { "lontium,lt9211" },
        {},
 };
index 1b31fdebe164063e6f3972fdf8a5801ef4c35c4e..8f25b338a8d8f95dc0691735ac6343675098f7f7 100644 (file)
@@ -1235,7 +1235,7 @@ static void lt9611_remove(struct i2c_client *client)
        of_node_put(lt9611->dsi0_node);
 }
 
-static struct i2c_device_id lt9611_id[] = {
+static const struct i2c_device_id lt9611_id[] = {
        { "lontium,lt9611", 0 },
        {}
 };
index 4d1d40e1f1b4d144f4aa9de7b83bedf13dfa4436..f89af8203c9d67cb05b629b27f66cf996baedd16 100644 (file)
@@ -913,7 +913,7 @@ static void lt9611uxc_remove(struct i2c_client *client)
        of_node_put(lt9611uxc->dsi0_node);
 }
 
-static struct i2c_device_id lt9611uxc_id[] = {
+static const struct i2c_device_id lt9611uxc_id[] = {
        { "lontium,lt9611uxc", 0 },
        { /* sentinel */ }
 };
index 57a7ed13f9965db5a32b601a2a7ca92314c68f7d..00d3bfa645f5a3435f11fc42c348a742410c62b2 100644 (file)
@@ -732,7 +732,7 @@ static void sn65dsi83_remove(struct i2c_client *client)
        drm_bridge_remove(&ctx->bridge);
 }
 
-static struct i2c_device_id sn65dsi83_id[] = {
+static const struct i2c_device_id sn65dsi83_id[] = {
        { "ti,sn65dsi83", MODEL_SN65DSI83 },
        { "ti,sn65dsi84", MODEL_SN65DSI84 },
        {},
index 9e31f750fd889745e74b707f0f7b095d8cc23a07..ce4c026b064f7227d880d19a431981f4bb037296 100644 (file)
@@ -1970,7 +1970,7 @@ static int ti_sn65dsi86_probe(struct i2c_client *client)
        return ti_sn65dsi86_add_aux_device(pdata, &pdata->aux_aux, "aux");
 }
 
-static struct i2c_device_id ti_sn65dsi86_id[] = {
+static const struct i2c_device_id ti_sn65dsi86_id[] = {
        { "ti,sn65dsi86", 0},
        {},
 };