s390: struct bus_type cleanup
Subsystems (5)
cover s390: struct bus_type cleanup
This series is part of an effort to cleanup the users of the driver core, as can be seen in many recent patches authored by Greg across the tree (e.g. [1]). Specifically, this series is part of the task of splitting one of his TODOs [2].
---
[1]: https://lore.kernel.org/lkml/?q=f%3Agregkh%40linuxfoundation.org+s%3A%22make%22+and+s%3A%22const%22
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=bus_cleanup&id=26105f537f0c60eacfeb430abd2e05d7ddcdd8aa
---
Ricardo B. Marliere (6):
s390: ccwgroup: make ccwgroup_bus_type const
s390: cio: make css_bus_type const
s390: cio: make ccw_bus_type const
s390: cio: make scm_bus_type const
s390: AP: make ap_bus_type const
s390: vfio-ap: make matrix_bus const
drivers/s390/cio/ccwgroup.c | 4 ++-- drivers/s390/cio/css.c | 4 ++-- drivers/s390/cio/device.c | 4 ++-- drivers/s390/cio/scm.c | 2 +- drivers/s390/crypto/ap_bus.c | 4 ++-- drivers/s390/crypto/vfio_ap_drv.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-)
---
base-commit: 8eb3db95a8c8ecd6f8bb082a99ded3bbc79b023f
change-id: 20240203-bus_cleanup-s390-82062bb32b2f
Best regards,
Signature · 1 line
Ricardo B. Marliere <[email protected]>
PATCH 1/6 s390: ccwgroup: make ccwgroup_bus_type const
Now that the driver core can properly handle constant struct bus_type, move the ccwgroup_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
--- drivers/s390/cio/ccwgroup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/cio/ccwgroup.c +2 -2
@@ -31,7 +31,7 @@* to devices that use multiple subchannels. */ -static struct bus_type ccwgroup_bus_type; +static const struct bus_type ccwgroup_bus_type;static void __ccwgroup_remove_symlinks (struct ccwgroup_device *gdev) {
@@ -465,7 +465,7 @@ static void ccwgroup_shutdown(struct device *dev) gdrv->shutdown (gdev); } -static struct bus_type ccwgroup_bus_type = { +static const struct bus_type ccwgroup_bus_type = { .name ="ccwgroup" , .dev_groups = ccwgroup_dev_groups, .remove = ccwgroup_remove,
Signature · 1 line
2.43.0
PATCH 2/6 s390: cio: make css_bus_type const
In reply to Ricardo B. MarliereNow that the driver core can properly handle constant struct bus_type, move the css_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
--- drivers/s390/cio/css.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/cio/css.c +2 -2
@@ -39,7 +39,7 @@ int max_ssid;#define MAX_CSS_IDX 0struct channel_subsystem *channel_subsystems[MAX_CSS_IDX +1 ]; -static struct bus_type css_bus_type; +static const struct bus_type css_bus_type;int for_each_subchannel (int (*fn)(struct subchannel_id ,void *),void *data)
@@ -1409,7 +1409,7 @@ static int css_uevent(const struct device *dev, struct kobj_uevent_env *env)return ret; } -static struct bus_type css_bus_type = { +static const struct bus_type css_bus_type = { .name ="css" , .match = css_bus_match, .probe = css_probe,
Signature · 1 line
2.43.0
PATCH 3/6 s390: cio: make ccw_bus_type const
In reply to Ricardo B. MarliereNow that the driver core can properly handle constant struct bus_type, move the ccw_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
--- drivers/s390/cio/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/cio/device.c +2 -2
@@ -49,7 +49,7 @@ static const unsigned long recovery_delay[] = { 3, 30, 300 };static atomic_t ccw_device_init_count =ATOMIC_INIT (0 );static DECLARE_WAIT_QUEUE_HEAD (ccw_device_init_wq); -static struct bus_type ccw_bus_type; +static const struct bus_type ccw_bus_type;/******************* bus type handling ***********************/
@@ -1776,7 +1776,7 @@ static void ccw_device_shutdown(struct device *dev)__disable_cmf (cdev); } -static struct bus_type ccw_bus_type = { +static const struct bus_type ccw_bus_type = { .name ="ccw" , .match = ccw_bus_match, .uevent = ccw_uevent,
Signature · 1 line
2.43.0
PATCH 4/6 s390: cio: make scm_bus_type const
In reply to Ricardo B. MarliereNow that the driver core can properly handle constant struct bus_type, move the scm_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
--- drivers/s390/cio/scm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/cio/scm.c +1 -1
@@ -42,7 +42,7 @@ static int scmdev_uevent(const struct device *dev, struct kobj_uevent_env *env)return add_uevent_var (env,"MODALIAS=scm:scmdev" ); } -static struct bus_type scm_bus_type = { +static const struct bus_type scm_bus_type = { .name ="scm" , .probe = scmdev_probe, .remove = scmdev_remove,
Signature · 1 line
2.43.0
PATCH 5/6 s390: AP: make ap_bus_type const
In reply to Ricardo B. MarliereNow that the driver core can properly handle constant struct bus_type, move the ap_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
--- drivers/s390/crypto/ap_bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/crypto/ap_bus.c +2 -2
@@ -135,7 +135,7 @@ static int ap_max_domain_id = 15;/* Maximum adapter id, if not given via qci */ static int ap_max_adapter_id =63 ; -static struct bus_type ap_bus_type; +static const struct bus_type ap_bus_type;/* Adapter interrupt definitions */ static void ap_interrupt_handler(struct airq_struct *airq,
@@ -1603,7 +1603,7 @@ static struct attribute *ap_bus_attrs[] = { };ATTRIBUTE_GROUPS (ap_bus); -static struct bus_type ap_bus_type = { +static const struct bus_type ap_bus_type = { .name ="ap" , .bus_groups = ap_bus_groups, .match = &ap_bus_match,
Signature · 1 line
2.43.0
Re: [PATCH 5/6] s390: AP: make ap_bus_type const
Quoted 25 lines · Ricardo B. Marliere
Now that the driver core can properly handle constant struct
bus_type, move theap_bus_typevariable 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]>--- drivers/s390/crypto/ap_bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/s390/crypto/ap_bus.c +1
-1@@ -135,7 +135,7 @@ static int ap_max_domain_id = 15;/* Maximum adapter id, if not given via qci */ static int ap_max_adapter_id =63 ; -static struct bus_type ap_bus_type; +static const struct bus_type ap_bus_type;/* Adapter interrupt definitions */ static void ap_interrupt_handler(struct airq_struct *airq,
drivers/s390/crypto/ap_bus.c static struct attribute *ap_bus_attrs[] = { · line 1609
Quoted 8 lines
drivers/s390/crypto/ap_bus.c +1
-1@@ -1603,7 +1603,7 @@ static struct attribute *ap_bus_attrs[] = { };ATTRIBUTE_GROUPS (ap_bus); -static struct bus_type ap_bus_type = { +static const struct bus_type ap_bus_type = { .name ="ap" , .bus_groups = ap_bus_groups, .match = &ap_bus_match,
PATCH 6/6 s390: vfio-ap: make matrix_bus const
In reply to Ricardo B. MarliereNow that the driver core can properly handle constant struct bus_type, move the matrix_bus variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
--- drivers/s390/crypto/vfio_ap_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/crypto/vfio_ap_drv.c +1 -1
@@ -60,7 +60,7 @@ static void vfio_ap_matrix_dev_release(struct device *dev)kfree (matrix_dev); } -static struct bus_type matrix_bus = { +static const struct bus_type matrix_bus = { .name ="matrix" , };
Signature · 1 line
2.43.0
Re: [PATCH 6/6] s390: vfio-ap: make matrix_bus const
Quoted 17 lines · Ricardo B. Marliere
Now that the driver core can properly handle constant struct
bus_type, move thematrix_busvariable 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]>--- drivers/s390/crypto/vfio_ap_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/s390/crypto/vfio_ap_drv.c +0
-0
drivers/s390/crypto/vfio_ap_drv.c static void vfio_ap_matrix_dev_release(struct device *dev) · line 66
Quoted 8 lines
drivers/s390/crypto/vfio_ap_drv.c +1
-1@@ -60,7 +60,7 @@ static void vfio_ap_matrix_dev_release(struct device *dev)kfree (matrix_dev); } -static struct bus_type matrix_bus = { +static const struct bus_type matrix_bus = { .name ="matrix" , };
Re: [PATCH 6/6] s390: vfio-ap: make matrix_bus const
In reply to Ricardo B. MarliereQuoted 25 lines · Ricardo B. Marliere
Now that the driver core can properly handle constant struct
bus_type, move thematrix_busvariable 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]>--- drivers/s390/crypto/vfio_ap_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/s390/crypto/vfio_ap_drv.c +1
-1@@ -60,7 +60,7 @@ static void vfio_ap_matrix_dev_release(struct device *dev)kfree (matrix_dev); } -static struct bus_type matrix_bus = { +static const struct bus_type matrix_bus = { .name ="matrix" , };
Re: [PATCH 6/6] s390: vfio-ap: make matrix_bus const
In reply to Ricardo B. MarliereQuoted 7 lines · On Sat, 03 Feb 2024 11:58:03 -0300 "Ricardo B. Marliere"…
Now that the driver core can properly handle constant struct
bus_type, move thematrix_busvariable 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]>
Quoted 10 lines · Ricardo B. Marliere
This series is part of an effort to cleanup the users of the driver core, as can be seen in many recent patches authored by Greg across the tree (e.g. [1]). Specifically, this series is part of the task of splitting one of his TODOs [2].
---
[1]: https://lore.kernel.org/lkml/?q=f%3Agregkh%40linuxfoundation.org+s%3A%22make%22+and+s%3A%22const%22
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=bus_cleanup&id=26105f537f0c60eacfeb430abd2e05d7ddcdd8aaSigned-off-by Ricardo B. Marliere <[email protected]>
Thanks for doing this!
Quoted 20 lines · Ricardo B. Marliere
This series is part of an effort to cleanup the users of the driver core, as can be seen in many recent patches authored by Greg across the tree (e.g. [1]). Specifically, this series is part of the task of splitting one of his TODOs [2].
---
[1]: https://lore.kernel.org/lkml/?q=f%3Agregkh%40linuxfoundation.org+s%3A%22make%22+and+s%3A%22const%22
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=bus_cleanup&id=26105f537f0c60eacfeb430abd2e05d7ddcdd8aaSigned-off-by Ricardo B. Marliere <[email protected]>---
Ricardo B. Marliere (6):
s390: ccwgroup: makeccwgroup_bus_typeconst
s390: cio: makecss_bus_typeconst
s390: cio: makeccw_bus_typeconst
s390: cio: makescm_bus_typeconst
s390: AP: makeap_bus_typeconst
s390: vfio-ap: makematrix_busconst
Quoted 7 lines
drivers/s390/cio/ccwgroup.c | 4 ++-- drivers/s390/cio/css.c | 4 ++-- drivers/s390/cio/device.c | 4 ++-- drivers/s390/cio/scm.c | 2 +- drivers/s390/crypto/ap_bus.c | 4 ++-- drivers/s390/crypto/vfio_ap_drv.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-)
Applied, thanks!