mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers: rapidio: make rio_bus_type const
@ 2025-09-19  7:32 Adrian Barnaś
  2025-09-19 15:39 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Barnaś @ 2025-09-19  7:32 UTC (permalink / raw)
  To: Matt Porter, Alexandre Bounine, linux-kernel
  Cc: Greg Kroah-Hartman, Adrian Barnaś

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

Signed-off-by: Adrian Barnaś <abarnas@google.com>
---
 drivers/rapidio/rio-driver.c | 2 +-
 include/linux/rio.h          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rapidio/rio-driver.c b/drivers/rapidio/rio-driver.c
index 238250e69005..bcfe0b45b377 100644
--- a/drivers/rapidio/rio-driver.c
+++ b/drivers/rapidio/rio-driver.c
@@ -227,7 +227,7 @@ struct class rio_mport_class = {
 };
 EXPORT_SYMBOL_GPL(rio_mport_class);
 
-struct bus_type rio_bus_type = {
+const struct bus_type rio_bus_type = {
 	.name = "rapidio",
 	.match = rio_match_bus,
 	.dev_groups = rio_dev_groups,
diff --git a/include/linux/rio.h b/include/linux/rio.h
index 3c29f40f3c94..2c29f21ba9e5 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -78,7 +78,7 @@
 #define RIO_CTAG_RESRVD	0xfffe0000 /* Reserved */
 #define RIO_CTAG_UDEVID	0x0001ffff /* Unique device identifier */
 
-extern struct bus_type rio_bus_type;
+extern const struct bus_type rio_bus_type;
 extern struct class rio_mport_class;
 
 struct rio_mport;
-- 
2.51.0.534.gc79095c0ca-goog


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

* Re: [PATCH] drivers: rapidio: make rio_bus_type const
  2025-09-19  7:32 [PATCH] drivers: rapidio: make rio_bus_type const Adrian Barnaś
@ 2025-09-19 15:39 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2025-09-19 15:39 UTC (permalink / raw)
  To: Adrian Barnaś; +Cc: Matt Porter, Alexandre Bounine, linux-kernel

On Fri, Sep 19, 2025 at 07:32:01AM +0000, Adrian Barnaś wrote:
> Because driver core can properly handle constant struct bus_type,
> move the rio_bus_type to be a constant structure as well, placing it into
> read-only memory which can not be modified at runtime.
> 
> Signed-off-by: Adrian Barnaś <abarnas@google.com>
> ---
>  drivers/rapidio/rio-driver.c | 2 +-
>  include/linux/rio.h          | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

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

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

end of thread, other threads:[~2025-09-19 15:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-19  7:32 [PATCH] drivers: rapidio: make rio_bus_type const Adrian Barnaś
2025-09-19 15:39 ` 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

all inboxes | Powered by JetHome®