Now that the driver core can properly handle constant struct bus_type,
move the coresight_bustype variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.
Cc: Suzuki K Poulose <[email protected]>
Cc: Mike Leach <[email protected]>
Cc: James Clark <[email protected]>
Cc: Leo Yan <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/hwtracing/coresight/coresight-core.c | 2 +-
include/linux/coresight.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
index 9fabe00a40d6..24c49e581737 100644
--- a/drivers/hwtracing/coresight/coresight-core.c
+++ b/drivers/hwtracing/coresight/coresight-core.c
@@ -1796,7 +1796,7 @@ char *coresight_alloc_device_name(struct coresight_dev_list *dict,
}
EXPORT_SYMBOL_GPL(coresight_alloc_device_name);
-struct bus_type coresight_bustype = {
+const struct bus_type coresight_bustype = {
.name = "coresight",
};
diff --git a/include/linux/coresight.h b/include/linux/coresight.h
index a269fffaf991..8fe75a0d7693 100644
--- a/include/linux/coresight.h
+++ b/include/linux/coresight.h
@@ -35,7 +35,7 @@
#define CORESIGHT_UNLOCK 0xc5acce55
-extern struct bus_type coresight_bustype;
+extern const struct bus_type coresight_bustype;
enum coresight_dev_type {
CORESIGHT_DEV_TYPE_SINK,
--
2.43.0
On 05/01/2024 12:33, Greg Kroah-Hartman wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the coresight_bustype variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
>
> Cc: Suzuki K Poulose <[email protected]>
> Cc: Mike Leach <[email protected]>
> Cc: James Clark <[email protected]>
> Cc: Leo Yan <[email protected]>
> Cc: Alexander Shishkin <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Greg Kroah-Hartman <[email protected]>
> ---
> drivers/hwtracing/coresight/coresight-core.c | 2 +-
> include/linux/coresight.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
> index 9fabe00a40d6..24c49e581737 100644
> --- a/drivers/hwtracing/coresight/coresight-core.c
> +++ b/drivers/hwtracing/coresight/coresight-core.c
> @@ -1796,7 +1796,7 @@ char *coresight_alloc_device_name(struct coresight_dev_list *dict,
> }
> EXPORT_SYMBOL_GPL(coresight_alloc_device_name);
>
> -struct bus_type coresight_bustype = {
> +const struct bus_type coresight_bustype = {
> .name = "coresight",
> };
>
> diff --git a/include/linux/coresight.h b/include/linux/coresight.h
> index a269fffaf991..8fe75a0d7693 100644
> --- a/include/linux/coresight.h
> +++ b/include/linux/coresight.h
> @@ -35,7 +35,7 @@
>
> #define CORESIGHT_UNLOCK 0xc5acce55
>
> -extern struct bus_type coresight_bustype;
> +extern const struct bus_type coresight_bustype;
Thanks, for the patch. I will queue this for v6.8.
Thanks
Suzuki
>
> enum coresight_dev_type {
> CORESIGHT_DEV_TYPE_SINK,
On Fri, Jan 05, 2024 at 02:22:43PM +0000, Suzuki K Poulose wrote:
> On 05/01/2024 12:33, Greg Kroah-Hartman wrote:
> > Now that the driver core can properly handle constant struct bus_type,
> > move the coresight_bustype variable to be a constant structure as well,
> > placing it into read-only memory which can not be modified at runtime.
> >
> > Cc: Suzuki K Poulose <[email protected]>
> > Cc: Mike Leach <[email protected]>
> > Cc: James Clark <[email protected]>
> > Cc: Leo Yan <[email protected]>
> > Cc: Alexander Shishkin <[email protected]>
> > Cc: [email protected]
> > Cc: [email protected]
> > Signed-off-by: Greg Kroah-Hartman <[email protected]>
> > ---
> > drivers/hwtracing/coresight/coresight-core.c | 2 +-
> > include/linux/coresight.h | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
> > index 9fabe00a40d6..24c49e581737 100644
> > --- a/drivers/hwtracing/coresight/coresight-core.c
> > +++ b/drivers/hwtracing/coresight/coresight-core.c
> > @@ -1796,7 +1796,7 @@ char *coresight_alloc_device_name(struct coresight_dev_list *dict,
> > }
> > EXPORT_SYMBOL_GPL(coresight_alloc_device_name);
> > -struct bus_type coresight_bustype = {
> > +const struct bus_type coresight_bustype = {
> > .name = "coresight",
> > };
> > diff --git a/include/linux/coresight.h b/include/linux/coresight.h
> > index a269fffaf991..8fe75a0d7693 100644
> > --- a/include/linux/coresight.h
> > +++ b/include/linux/coresight.h
> > @@ -35,7 +35,7 @@
> > #define CORESIGHT_UNLOCK 0xc5acce55
> > -extern struct bus_type coresight_bustype;
> > +extern const struct bus_type coresight_bustype;
>
> Thanks, for the patch. I will queue this for v6.8.
Thanks!
On Fri, 5 Jan 2024 13:33:32 +0100, Greg Kroah-Hartman wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the coresight_bustype variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
>
>
Moved to next, thanks!
[1/1] coresight: make coresight_bustype const
https://git.kernel.org/coresight/c/dd95255d44c0
Best regards,
--
Suzuki K Poulose <[email protected]>