]> Git Repo - J-linux.git/commitdiff
scsi: st: Make st_sysfs_class constant
authorRicardo B. Marliere <[email protected]>
Sat, 2 Mar 2024 16:47:26 +0000 (13:47 -0300)
committerMartin K. Petersen <[email protected]>
Sun, 10 Mar 2024 22:15:49 +0000 (18:15 -0400)
Since commit 43a7206b0963 ("driver core: class: make class_register() take
a const *"), the driver core allows for struct class to be in read-only
memory, so move the st_sysfs_class structure to be declared at build time
placing it into read-only memory, instead of having to be dynamically
allocated at boot time.

Cc: Greg Kroah-Hartman <[email protected]>
Suggested-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Ricardo B. Marliere <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin K. Petersen <[email protected]>
drivers/scsi/st.c

index 338aa8c429682ce2dd58c45b342228efadb81783..5a9bcf8e0792e56198eac5716a97476e53f712e6 100644 (file)
@@ -87,7 +87,7 @@ static int try_rdio = 1;
 static int try_wdio = 1;
 static int debug_flag;
 
-static struct class st_sysfs_class;
+static const struct class st_sysfs_class;
 static const struct attribute_group *st_dev_groups[];
 static const struct attribute_group *st_drv_groups[];
 
@@ -4438,7 +4438,7 @@ static void scsi_tape_release(struct kref *kref)
        return;
 }
 
-static struct class st_sysfs_class = {
+static const struct class st_sysfs_class = {
        .name = "scsi_tape",
        .dev_groups = st_dev_groups,
 };
This page took 0.05276 seconds and 4 git commands to generate.