public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/configfs: Constify struct configfs_item_operations and configfs_group_operations
@ 2026-05-25 12:35 Christophe JAILLET
  2026-05-25 21:15 ` Claude review: " Claude Code Review Bot
  2026-05-25 21:15 ` Claude Code Review Bot
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2026-05-25 12:35 UTC (permalink / raw)
  To: Matthew Brost, Thomas Hellström, Rodrigo Vivi, David Airlie,
	Simona Vetter
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, intel-xe,
	dri-devel

'struct configfs_item_operations' and 'configfs_group_operations' are not
modified in this driver.

Constifying these structures 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
  34095	  15704	    128	  49927	   c307	drivers/gpu/drm/xe/xe_configfs.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  34447	  15352	    128	  49927	   c307	drivers/gpu/drm/xe/xe_configfs.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile tested only.
---
 drivers/gpu/drm/xe/xe_configfs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c
index 32102600a148..5c2072f18a57 100644
--- a/drivers/gpu/drm/xe/xe_configfs.c
+++ b/drivers/gpu/drm/xe/xe_configfs.c
@@ -838,7 +838,7 @@ static void xe_config_device_release(struct config_item *item)
 	kfree(dev);
 }
 
-static struct configfs_item_operations xe_config_device_ops = {
+static const struct configfs_item_operations xe_config_device_ops = {
 	.release	= xe_config_device_release,
 };
 
@@ -855,7 +855,7 @@ static bool xe_config_device_is_visible(struct config_item *item,
 	return true;
 }
 
-static struct configfs_group_operations xe_config_device_group_ops = {
+static const struct configfs_group_operations xe_config_device_group_ops = {
 	.is_visible	= xe_config_device_is_visible,
 };
 
@@ -950,7 +950,7 @@ static bool xe_config_sriov_is_visible(struct config_item *item,
 	return true;
 }
 
-static struct configfs_group_operations xe_config_sriov_group_ops = {
+static const struct configfs_group_operations xe_config_sriov_group_ops = {
 	.is_visible	= xe_config_sriov_is_visible,
 };
 
@@ -1054,7 +1054,7 @@ static struct config_group *xe_config_make_device_group(struct config_group *gro
 	return &dev->group;
 }
 
-static struct configfs_group_operations xe_config_group_ops = {
+static const struct configfs_group_operations xe_config_group_ops = {
 	.make_group	= xe_config_make_device_group,
 };
 
-- 
2.54.0


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

end of thread, other threads:[~2026-05-25 21:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-25 12:35 [PATCH] drm/xe/configfs: Constify struct configfs_item_operations and configfs_group_operations Christophe JAILLET
2026-05-25 21:15 ` Claude review: " Claude Code Review Bot
2026-05-25 21:15 ` Claude Code Review Bot

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