All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] time: struct bus_type cleanup
@ 2024-02-04 13:40 Ricardo B. Marliere
  2024-02-04 13:40 ` [PATCH 1/2] clocksource: make clocksource_subsys const Ricardo B. Marliere
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 13:40 UTC (permalink / raw)
  To: John Stultz, Thomas Gleixner, Stephen Boyd
  Cc: linux-kernel, Greg Kroah-Hartman, 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=26105f537f0c60eacfeb430abd2e05d7ddcdd8aa

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

---
Ricardo B. Marliere (2):
      clocksource: make clocksource_subsys const
      clockevents: make clockevents_subsys const

 kernel/time/clockevents.c | 2 +-
 kernel/time/clocksource.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
base-commit: 71fee48fb772ac4f6cfa63dbebc5629de8b4cc09
change-id: 20240204-bus_cleanup-time-9586b102d5e4

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


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

* [PATCH 1/2] clocksource: make clocksource_subsys const
  2024-02-04 13:40 [PATCH 0/2] time: struct bus_type cleanup Ricardo B. Marliere
@ 2024-02-04 13:40 ` Ricardo B. Marliere
  2024-02-05 17:59   ` John Stultz
  2024-02-07 14:20   ` [tip: timers/core] clocksource: Make " tip-bot2 for Ricardo B. Marliere
  2024-02-04 13:40 ` [PATCH 2/2] clockevents: make clockevents_subsys const Ricardo B. Marliere
  2024-02-04 14:25 ` [PATCH 0/2] time: struct bus_type cleanup Greg Kroah-Hartman
  2 siblings, 2 replies; 7+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 13:40 UTC (permalink / raw)
  To: John Stultz, Thomas Gleixner, Stephen Boyd
  Cc: linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere

Now that the driver core can properly handle constant struct bus_type,
move the clocksource_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>
---
 kernel/time/clocksource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index c108ed8a9804..4f0932f0a0f6 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -1445,7 +1445,7 @@ static struct attribute *clocksource_attrs[] = {
 };
 ATTRIBUTE_GROUPS(clocksource);
 
-static struct bus_type clocksource_subsys = {
+static const struct bus_type clocksource_subsys = {
 	.name = "clocksource",
 	.dev_name = "clocksource",
 };

-- 
2.43.0


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

* [PATCH 2/2] clockevents: make clockevents_subsys const
  2024-02-04 13:40 [PATCH 0/2] time: struct bus_type cleanup Ricardo B. Marliere
  2024-02-04 13:40 ` [PATCH 1/2] clocksource: make clocksource_subsys const Ricardo B. Marliere
@ 2024-02-04 13:40 ` Ricardo B. Marliere
  2024-02-07 14:20   ` [tip: timers/core] clockevents: Make " tip-bot2 for Ricardo B. Marliere
  2024-02-04 14:25 ` [PATCH 0/2] time: struct bus_type cleanup Greg Kroah-Hartman
  2 siblings, 1 reply; 7+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 13:40 UTC (permalink / raw)
  To: John Stultz, Thomas Gleixner, Stephen Boyd
  Cc: linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere

Now that the driver core can properly handle constant struct bus_type,
move the clockevents_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>
---
 kernel/time/clockevents.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 960143b183cd..a7ca458cdd9c 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -659,7 +659,7 @@ void tick_cleanup_dead_cpu(int cpu)
 #endif
 
 #ifdef CONFIG_SYSFS
-static struct bus_type clockevents_subsys = {
+static const struct bus_type clockevents_subsys = {
 	.name		= "clockevents",
 	.dev_name       = "clockevent",
 };

-- 
2.43.0


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

* Re: [PATCH 0/2] time: struct bus_type cleanup
  2024-02-04 13:40 [PATCH 0/2] time: struct bus_type cleanup Ricardo B. Marliere
  2024-02-04 13:40 ` [PATCH 1/2] clocksource: make clocksource_subsys const Ricardo B. Marliere
  2024-02-04 13:40 ` [PATCH 2/2] clockevents: make clockevents_subsys const Ricardo B. Marliere
@ 2024-02-04 14:25 ` Greg Kroah-Hartman
  2 siblings, 0 replies; 7+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-04 14:25 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: John Stultz, Thomas Gleixner, Stephen Boyd, linux-kernel

On Sun, Feb 04, 2024 at 10:40:14AM -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>
> 
> ---
> Ricardo B. Marliere (2):
>       clocksource: make clocksource_subsys const
>       clockevents: make clockevents_subsys const

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

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

* Re: [PATCH 1/2] clocksource: make clocksource_subsys const
  2024-02-04 13:40 ` [PATCH 1/2] clocksource: make clocksource_subsys const Ricardo B. Marliere
@ 2024-02-05 17:59   ` John Stultz
  2024-02-07 14:20   ` [tip: timers/core] clocksource: Make " tip-bot2 for Ricardo B. Marliere
  1 sibling, 0 replies; 7+ messages in thread
From: John Stultz @ 2024-02-05 17:59 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Thomas Gleixner, Stephen Boyd, linux-kernel, Greg Kroah-Hartman

On Sun, Feb 4, 2024 at 5:39 AM Ricardo B. Marliere <ricardo@marliere.net> wrote:
>
> Now that the driver core can properly handle constant struct bus_type,
> move the clocksource_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>


Acked-by: John Stultz <jstultz@google.com>

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

* [tip: timers/core] clockevents: Make clockevents_subsys const
  2024-02-04 13:40 ` [PATCH 2/2] clockevents: make clockevents_subsys const Ricardo B. Marliere
@ 2024-02-07 14:20   ` tip-bot2 for Ricardo B. Marliere
  0 siblings, 0 replies; 7+ messages in thread
From: tip-bot2 for Ricardo B. Marliere @ 2024-02-07 14:20 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Greg Kroah-Hartman, Ricardo B. Marliere, Thomas Gleixner, x86,
	linux-kernel

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     49f1ff50d49fb8b40bc0271177de8092226396e9
Gitweb:        https://git.kernel.org/tip/49f1ff50d49fb8b40bc0271177de8092226396e9
Author:        Ricardo B. Marliere <ricardo@marliere.net>
AuthorDate:    Sun, 04 Feb 2024 10:40:16 -03:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Wed, 07 Feb 2024 15:11:24 +01:00

clockevents: Make clockevents_subsys const

Now that the driver core can properly handle constant struct bus_type,
move the clockevents_subsys variable 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 <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-time-v1-2-207ec18e24b8@marliere.net
---
 kernel/time/clockevents.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 960143b..a7ca458 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -659,7 +659,7 @@ void tick_cleanup_dead_cpu(int cpu)
 #endif
 
 #ifdef CONFIG_SYSFS
-static struct bus_type clockevents_subsys = {
+static const struct bus_type clockevents_subsys = {
 	.name		= "clockevents",
 	.dev_name       = "clockevent",
 };

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

* [tip: timers/core] clocksource: Make clocksource_subsys const
  2024-02-04 13:40 ` [PATCH 1/2] clocksource: make clocksource_subsys const Ricardo B. Marliere
  2024-02-05 17:59   ` John Stultz
@ 2024-02-07 14:20   ` tip-bot2 for Ricardo B. Marliere
  1 sibling, 0 replies; 7+ messages in thread
From: tip-bot2 for Ricardo B. Marliere @ 2024-02-07 14:20 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Greg Kroah-Hartman, Ricardo B. Marliere, Thomas Gleixner,
	John Stultz, x86, linux-kernel

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     2bc7fc24f9a85cb6b7335354b2733615727689f6
Gitweb:        https://git.kernel.org/tip/2bc7fc24f9a85cb6b7335354b2733615727689f6
Author:        Ricardo B. Marliere <ricardo@marliere.net>
AuthorDate:    Sun, 04 Feb 2024 10:40:15 -03:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Wed, 07 Feb 2024 15:11:24 +01:00

clocksource: Make clocksource_subsys const

Now that the driver core can properly handle constant struct bus_type,
move the clocksource_subsys variable 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 <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: John Stultz <jstultz@google.com>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-time-v1-1-207ec18e24b8@marliere.net
---
 kernel/time/clocksource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 3052b1f..4ef0665 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -1468,7 +1468,7 @@ static struct attribute *clocksource_attrs[] = {
 };
 ATTRIBUTE_GROUPS(clocksource);
 
-static struct bus_type clocksource_subsys = {
+static const struct bus_type clocksource_subsys = {
 	.name = "clocksource",
 	.dev_name = "clocksource",
 };

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

end of thread, other threads:[~2024-02-07 14:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-04 13:40 [PATCH 0/2] time: struct bus_type cleanup Ricardo B. Marliere
2024-02-04 13:40 ` [PATCH 1/2] clocksource: make clocksource_subsys const Ricardo B. Marliere
2024-02-05 17:59   ` John Stultz
2024-02-07 14:20   ` [tip: timers/core] clocksource: Make " tip-bot2 for Ricardo B. Marliere
2024-02-04 13:40 ` [PATCH 2/2] clockevents: make clockevents_subsys const Ricardo B. Marliere
2024-02-07 14:20   ` [tip: timers/core] clockevents: Make " tip-bot2 for Ricardo B. Marliere
2024-02-04 14:25 ` [PATCH 0/2] time: struct bus_type cleanup Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.