[PATCH net-next] net/9p/usbg: Constify struct configfs_item_operations
From: Christophe JAILLET
Date: Sat May 16 2026 - 05:08:46 EST
'struct configfs_item_operations' 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:
Before:
======
text data bss dec hex filename
25167 9336 256 34759 87c7 net/9p/trans_usbg.o
After:
=====
text data bss dec hex filename
25231 9272 256 34759 87c7 net/9p/trans_usbg.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
net/9p/trans_usbg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/9p/trans_usbg.c b/net/9p/trans_usbg.c
index 1ce70338999c..419cda13a7b5 100644
--- a/net/9p/trans_usbg.c
+++ b/net/9p/trans_usbg.c
@@ -804,7 +804,7 @@ static void usb9pfs_attr_release(struct config_item *item)
usb_put_function_instance(&usb9pfs_opts->func_inst);
}
-static struct configfs_item_operations usb9pfs_item_ops = {
+static const struct configfs_item_operations usb9pfs_item_ops = {
.release = usb9pfs_attr_release,
};
--
2.54.0