Skip to content

Commit 0822853

Browse files
rbmarlieremartinkpetersen
authored andcommitted
scsi: st: Make st_sysfs_class constant
Since commit 43a7206 ("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]>
1 parent ac9f3ac commit 0822853

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/scsi/st.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static int try_rdio = 1;
8787
static int try_wdio = 1;
8888
static int debug_flag;
8989

90-
static struct class st_sysfs_class;
90+
static const struct class st_sysfs_class;
9191
static const struct attribute_group *st_dev_groups[];
9292
static const struct attribute_group *st_drv_groups[];
9393

@@ -4438,7 +4438,7 @@ static void scsi_tape_release(struct kref *kref)
44384438
return;
44394439
}
44404440

4441-
static struct class st_sysfs_class = {
4441+
static const struct class st_sysfs_class = {
44424442
.name = "scsi_tape",
44434443
.dev_groups = st_dev_groups,
44444444
};

0 commit comments

Comments
 (0)