usb: gadget: Constify struct configfs_item_operations and configfs_group_operations

'struct configfs_item_operations' and 'configfs_group_operations' are not
modified in these drivers.

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
  65061	  20968	    256	  86285	  1510d	drivers/usb/gadget/configfs.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  66181	  19848	    256	  86285	  1510d	drivers/usb/gadget/configfs.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/49cec1cb84425f854de80b6d69b53a5a3cda8189.1766164523.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Christophe JAILLET
2025-12-19 18:16:15 +01:00
committed by Greg Kroah-Hartman
parent dd1fbe324a
commit e715bc42e3
20 changed files with 55 additions and 55 deletions

View File

@@ -21,7 +21,7 @@
usb_put_function_instance(&opts->func_inst); \
} \
\
static struct configfs_item_operations _f_##_item_ops = { \
static const struct configfs_item_operations _f_##_item_ops = { \
.release = _f_##_attr_release, \
}