From 2fadeb950f53c017bde9e156e443528265dd3629 Mon Sep 17 00:00:00 2001 From: "Ricardo B. Marliere" Date: Wed, 14 Feb 2024 16:15:00 -0300 Subject: kunit: make kunit_bus_type const 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 kunit_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 Suggested-by: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere Reviewed-by: Greg Kroah-Hartman Reviewed-by: David Gow Signed-off-by: Shuah Khan --- lib/kunit/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/kunit/device.c b/lib/kunit/device.c index 644a38a1f5b1..e20641559314 100644 --- a/lib/kunit/device.c +++ b/lib/kunit/device.c @@ -35,7 +35,7 @@ struct kunit_device { #define to_kunit_device(d) container_of_const(d, struct kunit_device, dev) -static struct bus_type kunit_bus_type = { +static const struct bus_type kunit_bus_type = { .name = "kunit", }; -- cgit v1.2.3