[PATCH] drm/armada: Constify struct drm_info_list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



'struct drm_info_list' is not modified in this driver.

Constifying this structure moves some data to a read-only section, so
increases overall security, especially when the structure holds some
function pointers.

On a x86_64, with allmodconfig, as an example:
Before:
======
   text	   data	    bss	    dec	    hex	filename
   1411	    320	      0	   1731	    6c3	drivers/gpu/drm/armada/armada_debugfs.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
   1683	     48	      0	   1731	    6c3	drivers/gpu/drm/armada/armada_debugfs.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
Compile tested only
---
 drivers/gpu/drm/armada/armada_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/armada/armada_debugfs.c b/drivers/gpu/drm/armada/armada_debugfs.c
index 96aebd56272f..f15b2143279f 100644
--- a/drivers/gpu/drm/armada/armada_debugfs.c
+++ b/drivers/gpu/drm/armada/armada_debugfs.c
@@ -98,7 +98,7 @@ void armada_drm_crtc_debugfs_init(struct armada_crtc *dcrtc)
 			    dcrtc, &armada_debugfs_crtc_reg_fops);
 }
 
-static struct drm_info_list armada_debugfs_list[] = {
+static const struct drm_info_list armada_debugfs_list[] = {
 	{ "gem_linear", armada_debugfs_gem_linear_show, 0 },
 };
 #define ARMADA_DEBUGFS_ENTRIES ARRAY_SIZE(armada_debugfs_list)
-- 
2.50.1





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux