mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tee: make tee_bus_type const
@ 2024-02-13 14:46 Ricardo B. Marliere
  2024-02-13 17:28 ` Greg Kroah-Hartman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ricardo B. Marliere @ 2024-02-13 14:46 UTC (permalink / raw)
  To: Jens Wiklander, Sumit Garg
  Cc: op-tee, 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 tee_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: Ricardo B. Marliere <ricardo@marliere.net>
---
 drivers/tee/tee_core.c  | 2 +-
 include/linux/tee_drv.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c
index 792d6fae4354..e59c20d74b36 100644
--- a/drivers/tee/tee_core.c
+++ b/drivers/tee/tee_core.c
@@ -1226,7 +1226,7 @@ static int tee_client_device_uevent(const struct device *dev,
 	return add_uevent_var(env, "MODALIAS=tee:%pUb", dev_id);
 }
 
-struct bus_type tee_bus_type = {
+const struct bus_type tee_bus_type = {
 	.name		= "tee",
 	.match		= tee_client_device_match,
 	.uevent		= tee_client_device_uevent,
diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h
index 911ddf92dcee..71632e3c5f18 100644
--- a/include/linux/tee_drv.h
+++ b/include/linux/tee_drv.h
@@ -482,7 +482,7 @@ static inline bool tee_param_is_memref(struct tee_param *param)
 	}
 }
 
-extern struct bus_type tee_bus_type;
+extern const struct bus_type tee_bus_type;
 
 /**
  * struct tee_client_device - tee based device

---
base-commit: 716f4aaa7b48a55c73d632d0657b35342b1fefd7
change-id: 20240213-bus_cleanup-tee-c25729bbcd7f

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


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

* Re: [PATCH] tee: make tee_bus_type const
  2024-02-13 14:46 [PATCH] tee: make tee_bus_type const Ricardo B. Marliere
@ 2024-02-13 17:28 ` Greg Kroah-Hartman
  2024-02-14 13:39 ` Sumit Garg
  2024-02-16 14:16 ` Jens Wiklander
  2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-13 17:28 UTC (permalink / raw)
  To: Ricardo B. Marliere; +Cc: Jens Wiklander, Sumit Garg, op-tee, linux-kernel

On Tue, Feb 13, 2024 at 11:46:25AM -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 tee_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: Ricardo B. Marliere <ricardo@marliere.net>

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

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

* Re: [PATCH] tee: make tee_bus_type const
  2024-02-13 14:46 [PATCH] tee: make tee_bus_type const Ricardo B. Marliere
  2024-02-13 17:28 ` Greg Kroah-Hartman
@ 2024-02-14 13:39 ` Sumit Garg
  2024-02-16 14:16 ` Jens Wiklander
  2 siblings, 0 replies; 4+ messages in thread
From: Sumit Garg @ 2024-02-14 13:39 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Jens Wiklander, op-tee, linux-kernel, Greg Kroah-Hartman

On Tue, 13 Feb 2024 at 20:15, Ricardo B. Marliere <ricardo@marliere.net> 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 tee_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: Ricardo B. Marliere <ricardo@marliere.net>
> ---
>  drivers/tee/tee_core.c  | 2 +-
>  include/linux/tee_drv.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>

-Sumit

> diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c
> index 792d6fae4354..e59c20d74b36 100644
> --- a/drivers/tee/tee_core.c
> +++ b/drivers/tee/tee_core.c
> @@ -1226,7 +1226,7 @@ static int tee_client_device_uevent(const struct device *dev,
>         return add_uevent_var(env, "MODALIAS=tee:%pUb", dev_id);
>  }
>
> -struct bus_type tee_bus_type = {
> +const struct bus_type tee_bus_type = {
>         .name           = "tee",
>         .match          = tee_client_device_match,
>         .uevent         = tee_client_device_uevent,
> diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h
> index 911ddf92dcee..71632e3c5f18 100644
> --- a/include/linux/tee_drv.h
> +++ b/include/linux/tee_drv.h
> @@ -482,7 +482,7 @@ static inline bool tee_param_is_memref(struct tee_param *param)
>         }
>  }
>
> -extern struct bus_type tee_bus_type;
> +extern const struct bus_type tee_bus_type;
>
>  /**
>   * struct tee_client_device - tee based device
>
> ---
> base-commit: 716f4aaa7b48a55c73d632d0657b35342b1fefd7
> change-id: 20240213-bus_cleanup-tee-c25729bbcd7f
>
> Best regards,
> --
> Ricardo B. Marliere <ricardo@marliere.net>
>

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

* Re: [PATCH] tee: make tee_bus_type const
  2024-02-13 14:46 [PATCH] tee: make tee_bus_type const Ricardo B. Marliere
  2024-02-13 17:28 ` Greg Kroah-Hartman
  2024-02-14 13:39 ` Sumit Garg
@ 2024-02-16 14:16 ` Jens Wiklander
  2 siblings, 0 replies; 4+ messages in thread
From: Jens Wiklander @ 2024-02-16 14:16 UTC (permalink / raw)
  To: Ricardo B. Marliere; +Cc: Sumit Garg, op-tee, linux-kernel, Greg Kroah-Hartman

On Tue, Feb 13, 2024 at 3:45 PM Ricardo B. Marliere
<ricardo@marliere.net> 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 tee_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: Ricardo B. Marliere <ricardo@marliere.net>
> ---
>  drivers/tee/tee_core.c  | 2 +-
>  include/linux/tee_drv.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

I'm picking up this.

Thanks,
Jens

>
> diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c
> index 792d6fae4354..e59c20d74b36 100644
> --- a/drivers/tee/tee_core.c
> +++ b/drivers/tee/tee_core.c
> @@ -1226,7 +1226,7 @@ static int tee_client_device_uevent(const struct device *dev,
>         return add_uevent_var(env, "MODALIAS=tee:%pUb", dev_id);
>  }
>
> -struct bus_type tee_bus_type = {
> +const struct bus_type tee_bus_type = {
>         .name           = "tee",
>         .match          = tee_client_device_match,
>         .uevent         = tee_client_device_uevent,
> diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h
> index 911ddf92dcee..71632e3c5f18 100644
> --- a/include/linux/tee_drv.h
> +++ b/include/linux/tee_drv.h
> @@ -482,7 +482,7 @@ static inline bool tee_param_is_memref(struct tee_param *param)
>         }
>  }
>
> -extern struct bus_type tee_bus_type;
> +extern const struct bus_type tee_bus_type;
>
>  /**
>   * struct tee_client_device - tee based device
>
> ---
> base-commit: 716f4aaa7b48a55c73d632d0657b35342b1fefd7
> change-id: 20240213-bus_cleanup-tee-c25729bbcd7f
>
> Best regards,
> --
> Ricardo B. Marliere <ricardo@marliere.net>
>

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-13 14:46 [PATCH] tee: make tee_bus_type const Ricardo B. Marliere
2024-02-13 17:28 ` Greg Kroah-Hartman
2024-02-14 13:39 ` Sumit Garg
2024-02-16 14:16 ` Jens Wiklander

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®