bus: mhi: host: make mhi_bus_type const
Subsystems (2)
PATCH 1/1 bus: mhi: host: make mhi_bus_type const
From: Kunwu Chan <[email protected]>
Now that the driver core can properly handle constant struct bus_type, move the mhi_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
--- drivers/bus/mhi/host/init.c | 2 +- drivers/bus/mhi/host/internal.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/bus/mhi/host/init.c +1 -1
@@ -1464,7 +1464,7 @@ static int mhi_match(struct device *dev, const struct device_driver *drv)return 0 ; }; -struct bus_type mhi_bus_type = { +const struct bus_type mhi_bus_type = { .name ="mhi" , .dev_name ="mhi" , .match = mhi_match,
drivers/bus/mhi/host/internal.h +1 -1
@@ -9,7 +9,7 @@#include "../common.h" -extern struct bus_type mhi_bus_type; +extern const struct bus_type mhi_bus_type;/* Host request register */ #define MHI_SOC_RESET_REQ_OFFSET 0xb0
Signature · 1 line
2.41.0
Quoted 8 lines · Kunwu Chan
From: Kunwu Chan <[email protected]>
Now that the driver core can properly handle constant struct
bus_type, move themhi_bus_typevariable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.Suggested-by Greg Kroah-Hartman <[email protected]>Signed-off-by Kunwu Chan <[email protected]>
- Mani
Quoted 34 lines
--- drivers/bus/mhi/host/init.c | 2 +- drivers/bus/mhi/host/internal.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/bus/mhi/host/init.c +1
-1@@ -1464,7 +1464,7 @@ static int mhi_match(struct device *dev, const struct device_driver *drv)return 0 ; }; -struct bus_type mhi_bus_type = { +const struct bus_type mhi_bus_type = { .name ="mhi" , .dev_name ="mhi" , .match = mhi_match,drivers/bus/mhi/host/internal.h +1
-1@@ -9,7 +9,7 @@#include "../common.h" -extern struct bus_type mhi_bus_type; +extern const struct bus_type mhi_bus_type;/* Host request register */ #define MHI_SOC_RESET_REQ_OFFSET 0xb0Signature · 1 line
2.41.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
Manivannan Sadhasivam
AppliedQuoted 8 lines · Kunwu Chan
From: Kunwu Chan <[email protected]>
Now that the driver core can properly handle constant struct
bus_type, move themhi_bus_typevariable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.Suggested-by Greg Kroah-Hartman <[email protected]>Signed-off-by Kunwu Chan <[email protected]>
Applied to mhi-next!
- Mani
Quoted 34 lines
--- drivers/bus/mhi/host/init.c | 2 +- drivers/bus/mhi/host/internal.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/bus/mhi/host/init.c +1
-1@@ -1464,7 +1464,7 @@ static int mhi_match(struct device *dev, const struct device_driver *drv)return 0 ; }; -struct bus_type mhi_bus_type = { +const struct bus_type mhi_bus_type = { .name ="mhi" , .dev_name ="mhi" , .match = mhi_match,drivers/bus/mhi/host/internal.h +1
-1@@ -9,7 +9,7 @@#include "../common.h" -extern struct bus_type mhi_bus_type; +extern const struct bus_type mhi_bus_type;/* Host request register */ #define MHI_SOC_RESET_REQ_OFFSET 0xb0Signature · 1 line
2.41.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்