patch "EDAC: constantify the struct bus_type usage" added to driver-core-testing
[email protected]
AppliedThis is a note to let you know that I've just added the patch titled
EDAC: constantify the struct bus_type usage
to my driver-core git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
in the driver-core-testing branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will be merged to the driver-core-next branch sometime soon, after it passes testing, and the merge window is open.
If you have any questions about this process, please let me know.
From f36be9ce8146faabdbbf74ee0499edb2039c53a5 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <[email protected]>
Date: Tue, 19 Dec 2023 14:13:10 +0100
Subject: EDAC: constantify the struct bus_type usage
In many places in the edac code, struct bus_type pointers are passed around and then eventually sent to the driver core, which can handle a constant pointer. So constantify all of the edac usage of these as well because the data in them is never modified by the edac code either.
--- drivers/edac/edac_device.h | 2 +- drivers/edac/edac_device_sysfs.c | 2 +- drivers/edac/edac_module.c | 4 ++-- drivers/edac/edac_pci_sysfs.c | 2 +- include/linux/edac.h | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-)
drivers/edac/edac_device.h +1 -1
@@ -176,7 +176,7 @@ struct edac_device_ctl_info {struct edac_dev_sysfs_attribute *sysfs_attributes;/* pointer to main 'edac' subsys in sysfs */ -struct bus_type *edac_subsys; +const struct bus_type *edac_subsys;/* the internal state of this controller instance */ int op_state;
drivers/edac/edac_device_sysfs.c +1 -1
@@ -229,7 +229,7 @@ static struct kobj_type ktype_device_ctrl = {int edac_device_register_sysfs_main_kobj (struct edac_device_ctl_info *edac_dev) {struct device *dev_root; -struct bus_type *edac_subsys; +const struct bus_type *edac_subsys;int err = -ENODEV ;edac_dbg (1 ,"\n" );
drivers/edac/edac_module.c +2 -2
@@ -67,7 +67,7 @@ char *edac_op_state_to_string(int opstate)* sysfs object: /sys/devices/system/edac * need to export to other files */ -static struct bus_type edac_subsys = { +static const struct bus_type edac_subsys = { .name ="edac" , .dev_name ="edac" , };
@@ -90,7 +90,7 @@ static void edac_subsys_exit(void) }/* return pointer to the 'edac' node in sysfs */ -struct bus_type *edac_get_sysfs_subsys (void ) +const struct bus_type *edac_get_sysfs_subsys (void ) {return &edac_subsys; }
drivers/edac/edac_pci_sysfs.c +1 -1
@@ -338,7 +338,7 @@ static struct kobj_type ktype_edac_pci_main_kobj = {static int edac_pci_main_kobj_setup (void ) {int err = -ENODEV ; -struct bus_type *edac_subsys; +const struct bus_type *edac_subsys;struct device *dev_root;edac_dbg (0 ,"\n" );
include/linux/edac.h +2 -2
@@ -30,7 +30,7 @@ struct device;extern int edac_op_state; -struct bus_type *edac_get_sysfs_subsys (void ); +const struct bus_type *edac_get_sysfs_subsys (void );static inline void opstate_init (void ) {
@@ -492,7 +492,7 @@ struct edac_raw_error_desc {*/ struct mem_ctl_info {struct device dev; -struct bus_type *bus; +const struct bus_type *bus;struct list_head link;/* for global list of mem_ctl_info structs */
Signature · 1 line
2.43.0