All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: mce: make mce_subsys const
@ 2024-02-04 14:32 Ricardo B. Marliere
  2024-02-04 14:38 ` Greg Kroah-Hartman
  2024-02-05  9:36 ` [tip: ras/core] x86/mce: Make " tip-bot2 for Ricardo B. Marliere
  0 siblings, 2 replies; 3+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 14:32 UTC (permalink / raw)
  To: Tony Luck, Borislav Petkov, Thomas Gleixner, Ingo Molnar,
	Dave Hansen, x86, H. Peter Anvin
  Cc: linux-edac, linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere

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

diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 7b397370b4d6..9bb208ba7ff4 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -2399,7 +2399,7 @@ static void mce_enable_ce(void *all)
 		__mcheck_cpu_init_timer();
 }
 
-static struct bus_type mce_subsys = {
+static const struct bus_type mce_subsys = {
 	.name		= "machinecheck",
 	.dev_name	= "machinecheck",
 };

---
base-commit: edc8fc01f608108b0b7580cb2c29dfb5135e5f0e
change-id: 20240204-bus_cleanup-x86-f25892c614f8

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


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

* Re: [PATCH] x86: mce: make mce_subsys const
  2024-02-04 14:32 [PATCH] x86: mce: make mce_subsys const Ricardo B. Marliere
@ 2024-02-04 14:38 ` Greg Kroah-Hartman
  2024-02-05  9:36 ` [tip: ras/core] x86/mce: Make " tip-bot2 for Ricardo B. Marliere
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-04 14:38 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Tony Luck, Borislav Petkov, Thomas Gleixner, Ingo Molnar,
	Dave Hansen, x86, H. Peter Anvin, linux-edac, linux-kernel

On Sun, Feb 04, 2024 at 11:32:29AM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the mce_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/x86/kernel/cpu/mce/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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

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

* [tip: ras/core] x86/mce: Make mce_subsys const
  2024-02-04 14:32 [PATCH] x86: mce: make mce_subsys const Ricardo B. Marliere
  2024-02-04 14:38 ` Greg Kroah-Hartman
@ 2024-02-05  9:36 ` tip-bot2 for Ricardo B. Marliere
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Ricardo B. Marliere @ 2024-02-05  9:36 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Greg Kroah-Hartman, Ricardo B. Marliere, Borislav Petkov (AMD),
	x86, linux-kernel

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

Commit-ID:     a6a789165bbdb506b784f53b7467dbe0210494ad
Gitweb:        https://git.kernel.org/tip/a6a789165bbdb506b784f53b7467dbe0210494ad
Author:        Ricardo B. Marliere <ricardo@marliere.net>
AuthorDate:    Sun, 04 Feb 2024 11:32:29 -03:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Mon, 05 Feb 2024 10:26:51 +01:00

x86/mce: Make mce_subsys const

Now that the driver core can properly handle constant struct bus_type,
make mce_subsys a constant structure.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-x86-v1-1-4e7171be88e8@marliere.net
---
 arch/x86/kernel/cpu/mce/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index bc39252..a2f78f6 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -2431,7 +2431,7 @@ static void mce_enable_ce(void *all)
 		__mcheck_cpu_init_timer();
 }
 
-static struct bus_type mce_subsys = {
+static const struct bus_type mce_subsys = {
 	.name		= "machinecheck",
 	.dev_name	= "machinecheck",
 };

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-04 14:32 [PATCH] x86: mce: make mce_subsys const Ricardo B. Marliere
2024-02-04 14:38 ` Greg Kroah-Hartman
2024-02-05  9:36 ` [tip: ras/core] x86/mce: Make " tip-bot2 for Ricardo B. Marliere

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.