scsi: qedi: Constify 'struct bin_attribute'
authorThomas Weißschuh <linux@weissschuh.net>
Mon, 16 Dec 2024 11:29:16 +0000 (12:29 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 2 Jan 2025 20:07:46 +0000 (15:07 -0500)
The sysfs core now allows instances of 'struct bin_attribute' to be moved
into read-only memory. Make use of that to protect them against accidental
or malicious modifications.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-9-f0a5e54b3437@weissschuh.net
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qedi/qedi_dbg.h

index fdda12ef13b0fd1f69103a28b8a9e8641281e151..5a1ec45421834bfed5f7d7b87391ae8cc4905c6e 100644 (file)
@@ -91,7 +91,7 @@ struct Scsi_Host;
 
 struct sysfs_bin_attrs {
        char *name;
-       struct bin_attribute *attr;
+       const struct bin_attribute *attr;
 };
 
 int qedi_create_sysfs_attr(struct Scsi_Host *shost,