* [PATCH] drm/armada: Constify struct drm_info_list
@ 2025-08-09 21:21 Christophe JAILLET
0 siblings, 0 replies; only message in thread
From: Christophe JAILLET @ 2025-08-09 21:21 UTC (permalink / raw)
To: Russell King, David Airlie, Simona Vetter
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, dri-devel
'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@wanadoo.fr>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-09 21:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-09 21:21 [PATCH] drm/armada: Constify struct drm_info_list Christophe JAILLET
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).