PNP: make pnp_bus_type const
Subsystems (2)
PATCH 1/1 PNP: make pnp_bus_type const
Now that the driver core can properly handle constant struct bus_type, move the pnp_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
Cc "Rafael J. Wysocki" <[email protected]>
Signed-off-by Greg Kroah-Hartman <[email protected]>
--- drivers/pnp/driver.c | 2 +- include/linux/pnp.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/pnp/driver.c +1 -1
@@ -256,7 +256,7 @@ static const struct dev_pm_ops pnp_bus_dev_pm_ops = { .restore = pnp_bus_resume, }; -struct bus_type pnp_bus_type = { +const struct bus_type pnp_bus_type = { .name ="pnp" , .match = pnp_bus_match, .probe = pnp_device_probe,
include/linux/pnp.h +1 -1
@@ -435,7 +435,7 @@ struct pnp_protocol {#define protocol_for_each_dev (protocol, dev) \ list_for_each_entry(dev, &(protocol)->devices, protocol_list) -extern struct bus_type pnp_bus_type; +extern const struct bus_type pnp_bus_type;#if defined(CONFIG_PNP )
Signature · 1 line
2.43.0
Quoted 31 lines · Greg Kroah-Hartman
Now that the driver core can properly handle constant struct
bus_type, move thepnp_bus_typevariable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.Cc "Rafael J. Wysocki" <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/pnp/driver.c | 2 +- include/linux/pnp.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/pnp/driver.c +1
-1@@ -256,7 +256,7 @@ static const struct dev_pm_ops pnp_bus_dev_pm_ops = { .restore = pnp_bus_resume, }; -struct bus_type pnp_bus_type = { +const struct bus_type pnp_bus_type = { .name ="pnp" , .match = pnp_bus_match, .probe = pnp_device_probe,include/linux/pnp.h +0
-0
include/linux/pnp.h struct pnp_protocol {
Quoted 9 lines
include/linux/pnp.h +1
-2@@ -435,7 +435,7 @@ struct pnp_protocol {#define protocol_for_each_dev (protocol, dev) \ list_for_each_entry(dev, &(protocol)->devices, protocol_list) -extern struct bus_type pnp_bus_type; +extern const struct bus_type pnp_bus_type;#if defined(CONFIG_PNP ) --
Applied as 6.8-rc1 material, thanks!