[PATCH v2] drm: tilcdc: tilcdc_tfp410: make of_device_ids const.

Arvind Yadav arvind.yadav.cs at gmail.com
Wed Jun 28 05:42:00 UTC 2017


of_device_ids are not supposed to change at runtime. All functions
working with of_device_ids provided by <linux/of.h> work with const
of_device_ids. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   1496	    592	      0	   2088	    828	drivers/gpu/drm/tilcdc/tilcdc_tfp410.o

File size after constify:
   text	   data	    bss	    dec	    hex	filename
   1880	    176	      0	   2056	    808	drivers/gpu/drm/tilcdc/tilcdc_tfp410.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs at gmail.com>
---
Changes in v1:
              Subject was not correct.

 drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
index aabfad8..236ca1e 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
@@ -290,8 +290,6 @@ static int tfp410_modeset_init(struct tilcdc_module *mod, struct drm_device *dev
  * Device:
  */
 
-static struct of_device_id tfp410_of_match[];
-
 static int tfp410_probe(struct platform_device *pdev)
 {
 	struct device_node *node = pdev->dev.of_node;
@@ -376,7 +374,7 @@ static int tfp410_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static struct of_device_id tfp410_of_match[] = {
+static const struct of_device_id tfp410_of_match[] = {
 		{ .compatible = "ti,tilcdc,tfp410", },
 		{ },
 };
-- 
1.9.1



More information about the dri-devel mailing list