coresight: make coresight_bustype const
PATCH 1/1 coresight: make coresight_bustype const
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.
--- drivers/hwtracing/coresight/coresight-core.c | 2 +- include/linux/coresight.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/hwtracing/coresight/coresight-core.c +1 -1
@@ -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" , };
include/linux/coresight.h +1 -1
@@ -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 ,
Signature · 1 line
2.43.0
Suzuki K Poulose
maintainerQuoted 35 lines · Greg Kroah-Hartman
Now that the driver core can properly handle constant struct
bus_type, move thecoresight_bustypevariable 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]>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(-)drivers/hwtracing/coresight/coresight-core.c +1
-1@@ -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" , };include/linux/coresight.h +0
-0
include/linux/coresight.h line 38
Quoted 5 lines
include/linux/coresight.h +1
-1@@ -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
Quoted 3 lines
include/linux/coresight.h +0
-0enum coresight_dev_type {CORESIGHT_DEV_TYPE_SINK ,
Quoted 31 lines · Suzuki K Poulose
Quoted 30 lines · Greg Kroah-Hartman
Now that the driver core can properly handle constant struct
bus_type, move thecoresight_bustypevariable 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]>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(-)drivers/hwtracing/coresight/coresight-core.c +1
-1@@ -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" , };include/linux/coresight.h +0
-0
Quoted 8 lines
include/linux/coresight.h line 36
Quoted 6 lines
include/linux/coresight.h +1
-1@@ -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 K Poulose
maintainerQuoted 5 lines · Greg Kroah-Hartman
Now that the driver core can properly handle constant struct
bus_type, move thecoresight_bustypevariable 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,
Signature · 1 line
Suzuki K Poulose <[email protected]>