Skip to content

Commit a0bcad2

Browse files
rbmarlieremartinkpetersen
authored andcommitted
scsi: core: Make scsi_bus_type const
Since commit d492cc2 ("driver core: device.h: make struct bus_type a const *"), the driver core can properly handle constant struct bus_type, move the scsi_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> Link: https://lore.kernel.org/r/20240212-bus_cleanup-scsi2-v2-1-65004493ff09@marliere.net Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent f7c7190 commit a0bcad2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/scsi/scsi_priv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ extern void scsi_sysfs_device_initialize(struct scsi_device *);
156156
extern struct scsi_transport_template blank_transport_template;
157157
extern void __scsi_remove_device(struct scsi_device *);
158158

159-
extern struct bus_type scsi_bus_type;
159+
extern const struct bus_type scsi_bus_type;
160160
extern const struct attribute_group *scsi_shost_groups[];
161161

162162
/* scsi_netlink.c */

drivers/scsi/scsi_sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ static int scsi_bus_uevent(const struct device *dev, struct kobj_uevent_env *env
549549
return 0;
550550
}
551551

552-
struct bus_type scsi_bus_type = {
552+
const struct bus_type scsi_bus_type = {
553553
.name = "scsi",
554554
.match = scsi_bus_match,
555555
.uevent = scsi_bus_uevent,

0 commit comments

Comments
 (0)