mips: bus: make mips_cdmm_bustype const
Subsystems (2)
PATCH 1/1 mips: bus: make mips_cdmm_bustype const
Now that the driver core can properly handle constant struct bus_type, move the mips_cdmm_bustype variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
--- arch/mips/include/asm/cdmm.h | 2 +- drivers/bus/mips_cdmm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/mips/include/asm/cdmm.h +1 -1
@@ -63,7 +63,7 @@ struct mips_cdmm_driver {*/ phys_addr_t mips_cdmm_phys_base (void ); -extern struct bus_type mips_cdmm_bustype; +extern const struct bus_type mips_cdmm_bustype;void __iomem *mips_cdmm_early_probe (unsigned int dev_type);#define to_mips_cdmm_device (d) container_of(d, struct mips_cdmm_device, dev)
drivers/bus/mips_cdmm.c +1 -1
@@ -118,7 +118,7 @@ static struct attribute *mips_cdmm_dev_attrs[] = { };ATTRIBUTE_GROUPS (mips_cdmm_dev); -struct bus_type mips_cdmm_bustype = { +const struct bus_type mips_cdmm_bustype = { .name ="cdmm" , .dev_groups = mips_cdmm_dev_groups, .match = mips_cdmm_match,
---
base-commit: 841c35169323cd833294798e58b9bf63fa4fa1de
change-id: 20240213-bus_cleanup-mips2-434cc6d8f7bd
Best regards,
Signature · 1 line
Ricardo B. Marliere <[email protected]>
Quoted 8 lines · Ricardo B. Marliere
Now that the driver core can properly handle constant struct
bus_type, move themips_cdmm_bustypevariable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.Cc Greg Kroah-Hartman <[email protected]>Suggested-by Greg Kroah-Hartman <[email protected]>Signed-off-by Ricardo B. Marliere <[email protected]>---
Hi Ricardo
Quoted 3 lines · Ricardo B. Marliere
Now that the driver core can properly handle constant struct
bus_type, move themips_cdmm_bustypevariable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
Thanks for the patch.
-Serge(y)
Quoted 44 lines
Cc Greg Kroah-Hartman <[email protected]>Suggested-by Greg Kroah-Hartman <[email protected]>Signed-off-by Ricardo B. Marliere <[email protected]>--- arch/mips/include/asm/cdmm.h | 2 +- drivers/bus/mips_cdmm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)arch/mips/include/asm/cdmm.h +1
-1@@ -63,7 +63,7 @@ struct mips_cdmm_driver {*/ phys_addr_t mips_cdmm_phys_base (void ); -extern struct bus_type mips_cdmm_bustype; +extern const struct bus_type mips_cdmm_bustype;void __iomem *mips_cdmm_early_probe (unsigned int dev_type);#define to_mips_cdmm_device (d) container_of(d, struct mips_cdmm_device, dev)drivers/bus/mips_cdmm.c +1
-2@@ -118,7 +118,7 @@ static struct attribute *mips_cdmm_dev_attrs[] = { };ATTRIBUTE_GROUPS (mips_cdmm_dev); -struct bus_type mips_cdmm_bustype = { +const struct bus_type mips_cdmm_bustype = { .name ="cdmm" , .dev_groups = mips_cdmm_dev_groups, .match = mips_cdmm_match, ---base-commit:
841c35169323cd833294798e58b9bf63fa4fa1de
change-id: 20240213-bus_cleanup-mips2-434cc6d8f7bdBest regards,
Signature · 1 line
Ricardo B. Marliere <[email protected]>
Quoted 11 lines · Ricardo B. Marliere
Now that the driver core can properly handle constant struct
bus_type, move themips_cdmm_bustypevariable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.Cc Greg Kroah-Hartman <[email protected]>Suggested-by Greg Kroah-Hartman <[email protected]>Signed-off-by Ricardo B. Marliere <[email protected]>--- arch/mips/include/asm/cdmm.h | 2 +- drivers/bus/mips_cdmm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
applied to mips-next.
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]