* [PATCH] gpu: host1x: Make host1x_context_device_bus_type constant
@ 2024-08-23 8:07 Kunwu Chan
2024-08-29 15:48 ` Thierry Reding
0 siblings, 1 reply; 2+ messages in thread
From: Kunwu Chan @ 2024-08-23 8:07 UTC (permalink / raw)
To: thierry.reding, mperttunen, airlied, daniel
Cc: dri-devel, linux-tegra, linux-kernel, Kunwu Chan,
Greg Kroah-Hartman
From: Kunwu Chan <chentao@kylinos.cn>
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 host1x_context_device_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: Kunwu Chan <chentao@kylinos.cn>
---
drivers/gpu/host1x/context_bus.c | 2 +-
include/linux/host1x_context_bus.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/host1x/context_bus.c b/drivers/gpu/host1x/context_bus.c
index d9421179d7b4..7cd0e1a5edd1 100644
--- a/drivers/gpu/host1x/context_bus.c
+++ b/drivers/gpu/host1x/context_bus.c
@@ -6,7 +6,7 @@
#include <linux/device.h>
#include <linux/of.h>
-struct bus_type host1x_context_device_bus_type = {
+const struct bus_type host1x_context_device_bus_type = {
.name = "host1x-context",
};
EXPORT_SYMBOL_GPL(host1x_context_device_bus_type);
diff --git a/include/linux/host1x_context_bus.h b/include/linux/host1x_context_bus.h
index 72462737a6db..c928cb432680 100644
--- a/include/linux/host1x_context_bus.h
+++ b/include/linux/host1x_context_bus.h
@@ -9,7 +9,7 @@
#include <linux/device.h>
#ifdef CONFIG_TEGRA_HOST1X_CONTEXT_BUS
-extern struct bus_type host1x_context_device_bus_type;
+extern const struct bus_type host1x_context_device_bus_type;
#endif
#endif
--
2.41.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] gpu: host1x: Make host1x_context_device_bus_type constant
2024-08-23 8:07 [PATCH] gpu: host1x: Make host1x_context_device_bus_type constant Kunwu Chan
@ 2024-08-29 15:48 ` Thierry Reding
0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2024-08-29 15:48 UTC (permalink / raw)
To: Kunwu Chan
Cc: mperttunen, airlied, daniel, dri-devel, linux-tegra, linux-kernel,
Kunwu Chan, Greg Kroah-Hartman
[-- Attachment #1: Type: text/plain, Size: 779 bytes --]
On Fri, Aug 23, 2024 at 04:07:24PM GMT, Kunwu Chan wrote:
> From: Kunwu Chan <chentao@kylinos.cn>
>
> 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 host1x_context_device_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: Kunwu Chan <chentao@kylinos.cn>
> ---
> drivers/gpu/host1x/context_bus.c | 2 +-
> include/linux/host1x_context_bus.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-29 15:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-23 8:07 [PATCH] gpu: host1x: Make host1x_context_device_bus_type constant Kunwu Chan
2024-08-29 15:48 ` Thierry Reding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox