mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] slimbus: core: make slimbus_bus const
@ 2024-02-13 14:40 Ricardo B. Marliere
  2024-02-13 17:29 ` Greg Kroah-Hartman
  2024-02-21 10:18 ` Srinivas Kandagatla
  0 siblings, 2 replies; 3+ messages in thread
From: Ricardo B. Marliere @ 2024-02-13 14:40 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: alsa-devel, linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere

Since commit d492cc2573a0 ("driver core: device.h: make struct
bus_type a const *"), the driver core can properly handle constant
struct bus_type, move the slimbus_bus 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>
---
This patch is based on
https://git.kernel.org/pub/scm/linux/kernel/git/srini/slimbus.git/,
should this tree be listed under "SERIAL LOW-POWER INTER-CHIP MEDIA BUS
(SLIMbus)" in the MAINTAINERS file?
---
 drivers/slimbus/core.c  | 2 +-
 include/linux/slimbus.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c
index d43873bb5fe6..375218e02e28 100644
--- a/drivers/slimbus/core.c
+++ b/drivers/slimbus/core.c
@@ -100,7 +100,7 @@ static int slim_device_uevent(const struct device *dev, struct kobj_uevent_env *
 	return add_uevent_var(env, "MODALIAS=slim:%s", dev_name(&sbdev->dev));
 }
 
-struct bus_type slimbus_bus = {
+const struct bus_type slimbus_bus = {
 	.name		= "slimbus",
 	.match		= slim_device_match,
 	.probe		= slim_device_probe,
diff --git a/include/linux/slimbus.h b/include/linux/slimbus.h
index 12c9719b2a55..3042385b7b40 100644
--- a/include/linux/slimbus.h
+++ b/include/linux/slimbus.h
@@ -10,7 +10,7 @@
 #include <linux/completion.h>
 #include <linux/mod_devicetable.h>
 
-extern struct bus_type slimbus_bus;
+extern const struct bus_type slimbus_bus;
 
 /**
  * struct slim_eaddr - Enumeration address for a SLIMbus device

---
base-commit: 04b945e4cf81a12365f8207a4d34dbc81ba17413
change-id: 20240213-bus_cleanup-slimbus-e23b9e976fd2

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


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

* Re: [PATCH] slimbus: core: make slimbus_bus const
  2024-02-13 14:40 [PATCH] slimbus: core: make slimbus_bus const Ricardo B. Marliere
@ 2024-02-13 17:29 ` Greg Kroah-Hartman
  2024-02-21 10:18 ` Srinivas Kandagatla
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-13 17:29 UTC (permalink / raw)
  To: Ricardo B. Marliere; +Cc: Srinivas Kandagatla, alsa-devel, linux-kernel

On Tue, Feb 13, 2024 at 11:40:35AM -0300, Ricardo B. Marliere wrote:
> Since commit d492cc2573a0 ("driver core: device.h: make struct
> bus_type a const *"), the driver core can properly handle constant
> struct bus_type, move the slimbus_bus 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

* Re: [PATCH] slimbus: core: make slimbus_bus const
  2024-02-13 14:40 [PATCH] slimbus: core: make slimbus_bus const Ricardo B. Marliere
  2024-02-13 17:29 ` Greg Kroah-Hartman
@ 2024-02-21 10:18 ` Srinivas Kandagatla
  1 sibling, 0 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2024-02-21 10:18 UTC (permalink / raw)
  To: Ricardo B. Marliere; +Cc: alsa-devel, linux-kernel, Greg Kroah-Hartman


On Tue, 13 Feb 2024 11:40:35 -0300, Ricardo B. Marliere wrote:
> Since commit d492cc2573a0 ("driver core: device.h: make struct
> bus_type a const *"), the driver core can properly handle constant
> struct bus_type, move the slimbus_bus variable to be a constant
> structure as well, placing it into read-only memory which can not be
> modified at runtime.
> 
> 
> [...]

Applied, thanks!

[1/1] slimbus: core: make slimbus_bus const
      commit: bcb0dafbb3fff9f017d5d915a55831616a36ad75

Best regards,
-- 
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>


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

end of thread, other threads:[~2024-02-21 10:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-13 14:40 [PATCH] slimbus: core: make slimbus_bus const Ricardo B. Marliere
2024-02-13 17:29 ` Greg Kroah-Hartman
2024-02-21 10:18 ` Srinivas Kandagatla

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®