powerpc: pseries: making bus_type structures const
cover powerpc: pseries: making bus_type structures const
Current driver core properly handle constant bus_type structures. Both changes are moving bus_type structures to be constant. It is a part of tree clean-up from non const bus_type structures
Adrian Barnaś (2):
powerpc: pseries: make suspend_subsys const
powerpc: pseries: make cmm_subsys const
arch/powerpc/platforms/pseries/cmm.c | 2 +- arch/powerpc/platforms/pseries/suspend.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.51.0.470.ga7dc726c21-goog
PATCH 1/2 powerpc: pseries: make suspend_subsys const
Because driver core can properly handle constant struct bus_type, move the suspend_subsys to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
--- arch/powerpc/platforms/pseries/suspend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/pseries/suspend.c +1 -1
@@ -126,7 +126,7 @@ static ssize_t show_hibernate(struct device *dev, static DEVICE_ATTR(hibernate, 0644, show_hibernate, store_hibernate); -static struct bus_type suspend_subsys = { +static const struct bus_type suspend_subsys = { .name ="power" , .dev_name ="power" , };
Signature · 1 line
2.51.0.470.ga7dc726c21-goog
PATCH 2/2 powerpc: pseries: make cmm_subsys const
In reply to Adrian BarnaśBecause driver core can properly handle constant struct bus_type, move the cmm_subsys to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
--- arch/powerpc/platforms/pseries/cmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/pseries/cmm.c +1 -1
@@ -375,7 +375,7 @@ static struct device_attribute *cmm_attrs[] = { static DEVICE_ULONG_ATTR(simulate_loan_target_kb, 0644, simulate_loan_target_kb); -static struct bus_type cmm_subsys = { +static const struct bus_type cmm_subsys = { .name ="cmm" , .dev_name ="cmm" , };
Signature · 1 line
2.51.0.470.ga7dc726c21-goog
Quoted 4 lines · Adrian Barnaś
Current driver core properly handle constant
bus_typestructures. Both changes are movingbus_typestructures to be constant. It is a part of tree clean-up from non constbus_typestructures
Quoted 11 lines
Adrian Barnaś (2):
powerpc: pseries: makesuspend_subsysconst
powerpc: pseries: makecmm_subsysconstarch/powerpc/platforms/pseries/cmm.c | 2 +- arch/powerpc/platforms/pseries/suspend.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Signature · 1 line
2.51.0.470.ga7dc726c21-goog