linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] powerpc: struct bus_type cleanup
@ 2024-02-04 14:21 Ricardo B. Marliere
  2024-02-04 14:21 ` [PATCH 1/4] powerpc: cell: make spu_subsys const Ricardo B. Marliere
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 14:21 UTC (permalink / raw)
  To: Arnd Bergmann, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, Geoff Levand
  Cc: Greg Kroah-Hartman, Ricardo B. Marliere, linuxppc-dev,
	linux-kernel

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

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>

---
Ricardo B. Marliere (4):
      powerpc: cell: make spu_subsys const
      powerpc: ps3: make ps3_system_bus_type const
      powerpc: pseries: make cmm_subsys const
      powerpc: pseries: make suspend_subsys const

 arch/powerpc/platforms/cell/spu_base.c   | 2 +-
 arch/powerpc/platforms/ps3/system-bus.c  | 2 +-
 arch/powerpc/platforms/pseries/cmm.c     | 2 +-
 arch/powerpc/platforms/pseries/suspend.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
---
base-commit: 44a1aad2fe6c10bfe0589d8047057b10a4c18a19
change-id: 20240204-bus_cleanup-powerpc-720c27d8f15c

Best regards,
-- 
Ricardo B. Marliere <ricardo@marliere.net>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/4] powerpc: cell: make spu_subsys const
  2024-02-04 14:21 [PATCH 0/4] powerpc: struct bus_type cleanup Ricardo B. Marliere
@ 2024-02-04 14:21 ` Ricardo B. Marliere
  2024-02-04 14:21 ` [PATCH 2/4] powerpc: ps3: make ps3_system_bus_type const Ricardo B. Marliere
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 14:21 UTC (permalink / raw)
  To: Arnd Bergmann, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, Geoff Levand
  Cc: Greg Kroah-Hartman, Ricardo B. Marliere, linuxppc-dev,
	linux-kernel

Now that the driver core can properly handle constant struct bus_type,
move the spu_subsys variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
 arch/powerpc/platforms/cell/spu_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index dea6f0f25897..346e433d2706 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -465,7 +465,7 @@ void spu_init_channels(struct spu *spu)
 }
 EXPORT_SYMBOL_GPL(spu_init_channels);
 
-static struct bus_type spu_subsys = {
+static const struct bus_type spu_subsys = {
 	.name = "spu",
 	.dev_name = "spu",
 };

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/4] powerpc: ps3: make ps3_system_bus_type const
  2024-02-04 14:21 [PATCH 0/4] powerpc: struct bus_type cleanup Ricardo B. Marliere
  2024-02-04 14:21 ` [PATCH 1/4] powerpc: cell: make spu_subsys const Ricardo B. Marliere
@ 2024-02-04 14:21 ` Ricardo B. Marliere
  2024-02-04 20:47   ` Geert Uytterhoeven
  2024-02-05  0:04   ` Geoff Levand
  2024-02-04 14:21 ` [PATCH 3/4] powerpc: pseries: make cmm_subsys const Ricardo B. Marliere
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 8+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 14:21 UTC (permalink / raw)
  To: Arnd Bergmann, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, Geoff Levand
  Cc: Greg Kroah-Hartman, Ricardo B. Marliere, linuxppc-dev,
	linux-kernel

Now that the driver core can properly handle constant struct bus_type,
move the ps3_system_bus_type variable to be a constant structure as
well, placing it into read-only memory which can not be modified at
runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
 arch/powerpc/platforms/ps3/system-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index d6b5f5ecd515..b4298e98ffe8 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -466,7 +466,7 @@ static struct attribute *ps3_system_bus_dev_attrs[] = {
 };
 ATTRIBUTE_GROUPS(ps3_system_bus_dev);
 
-static struct bus_type ps3_system_bus_type = {
+static const struct bus_type ps3_system_bus_type = {
 	.name = "ps3_system_bus",
 	.match = ps3_system_bus_match,
 	.uevent = ps3_system_bus_uevent,

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/4] powerpc: pseries: make cmm_subsys const
  2024-02-04 14:21 [PATCH 0/4] powerpc: struct bus_type cleanup Ricardo B. Marliere
  2024-02-04 14:21 ` [PATCH 1/4] powerpc: cell: make spu_subsys const Ricardo B. Marliere
  2024-02-04 14:21 ` [PATCH 2/4] powerpc: ps3: make ps3_system_bus_type const Ricardo B. Marliere
@ 2024-02-04 14:21 ` Ricardo B. Marliere
  2024-02-04 14:21 ` [PATCH 4/4] powerpc: pseries: make suspend_subsys const Ricardo B. Marliere
  2024-02-04 14:38 ` [PATCH 0/4] powerpc: struct bus_type cleanup Greg Kroah-Hartman
  4 siblings, 0 replies; 8+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 14:21 UTC (permalink / raw)
  To: Arnd Bergmann, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, Geoff Levand
  Cc: Greg Kroah-Hartman, Ricardo B. Marliere, linuxppc-dev,
	linux-kernel

Now that the driver core can properly handle constant struct bus_type,
move the cmm_subsys variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
 arch/powerpc/platforms/pseries/cmm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c
index 5f4037c1d7fe..6307dacc3862 100644
--- a/arch/powerpc/platforms/pseries/cmm.c
+++ b/arch/powerpc/platforms/pseries/cmm.c
@@ -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",
 };

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/4] powerpc: pseries: make suspend_subsys const
  2024-02-04 14:21 [PATCH 0/4] powerpc: struct bus_type cleanup Ricardo B. Marliere
                   ` (2 preceding siblings ...)
  2024-02-04 14:21 ` [PATCH 3/4] powerpc: pseries: make cmm_subsys const Ricardo B. Marliere
@ 2024-02-04 14:21 ` Ricardo B. Marliere
  2024-02-04 14:38 ` [PATCH 0/4] powerpc: struct bus_type cleanup Greg Kroah-Hartman
  4 siblings, 0 replies; 8+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 14:21 UTC (permalink / raw)
  To: Arnd Bergmann, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, Geoff Levand
  Cc: Greg Kroah-Hartman, Ricardo B. Marliere, linuxppc-dev,
	linux-kernel

Now that the driver core can properly handle constant struct bus_type,
move the suspend_subsys variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
 arch/powerpc/platforms/pseries/suspend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c
index 382003dfdb9a..c51db63d3e88 100644
--- a/arch/powerpc/platforms/pseries/suspend.c
+++ b/arch/powerpc/platforms/pseries/suspend.c
@@ -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",
 };

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] powerpc: struct bus_type cleanup
  2024-02-04 14:21 [PATCH 0/4] powerpc: struct bus_type cleanup Ricardo B. Marliere
                   ` (3 preceding siblings ...)
  2024-02-04 14:21 ` [PATCH 4/4] powerpc: pseries: make suspend_subsys const Ricardo B. Marliere
@ 2024-02-04 14:38 ` Greg Kroah-Hartman
  4 siblings, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-04 14:38 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Arnd Bergmann, Geoff Levand, linux-kernel, Nicholas Piggin,
	linuxppc-dev

On Sun, Feb 04, 2024 at 11:21:54AM -0300, Ricardo B. Marliere wrote:
> 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
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/4] powerpc: ps3: make ps3_system_bus_type const
  2024-02-04 14:21 ` [PATCH 2/4] powerpc: ps3: make ps3_system_bus_type const Ricardo B. Marliere
@ 2024-02-04 20:47   ` Geert Uytterhoeven
  2024-02-05  0:04   ` Geoff Levand
  1 sibling, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2024-02-04 20:47 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Arnd Bergmann, Geoff Levand, linux-kernel, Nicholas Piggin,
	Greg Kroah-Hartman, linuxppc-dev

On Sun, Feb 4, 2024 at 3:23 PM Ricardo B. Marliere <ricardo@marliere.net> wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the ps3_system_bus_type variable to be a constant structure as
> well, placing it into read-only memory which can not be modified at
> runtime.
>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/4] powerpc: ps3: make ps3_system_bus_type const
  2024-02-04 14:21 ` [PATCH 2/4] powerpc: ps3: make ps3_system_bus_type const Ricardo B. Marliere
  2024-02-04 20:47   ` Geert Uytterhoeven
@ 2024-02-05  0:04   ` Geoff Levand
  1 sibling, 0 replies; 8+ messages in thread
From: Geoff Levand @ 2024-02-05  0:04 UTC (permalink / raw)
  To: Ricardo B. Marliere, Arnd Bergmann, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy
  Cc: Greg Kroah-Hartman, linuxppc-dev, linux-kernel

On 2/4/24 23:21, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the ps3_system_bus_type variable to be a constant structure as
> well, placing it into read-only memory which can not be modified at
> runtime.

> -static struct bus_type ps3_system_bus_type = {
> +static const struct bus_type ps3_system_bus_type = {
>  	.name = "ps3_system_bus",
>  	.match = ps3_system_bus_match,
>  	.uevent = ps3_system_bus_uevent,

Seems fine.

Acked-by: Geoff Levand <geoff@infradead.org>

 


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-02-05  4:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-04 14:21 [PATCH 0/4] powerpc: struct bus_type cleanup Ricardo B. Marliere
2024-02-04 14:21 ` [PATCH 1/4] powerpc: cell: make spu_subsys const Ricardo B. Marliere
2024-02-04 14:21 ` [PATCH 2/4] powerpc: ps3: make ps3_system_bus_type const Ricardo B. Marliere
2024-02-04 20:47   ` Geert Uytterhoeven
2024-02-05  0:04   ` Geoff Levand
2024-02-04 14:21 ` [PATCH 3/4] powerpc: pseries: make cmm_subsys const Ricardo B. Marliere
2024-02-04 14:21 ` [PATCH 4/4] powerpc: pseries: make suspend_subsys const Ricardo B. Marliere
2024-02-04 14:38 ` [PATCH 0/4] powerpc: struct bus_type cleanup Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).