Skip to content

Commit 2fadeb9

Browse files
rbmarliereshuahkh
authored andcommitted
kunit: make kunit_bus_type const
Since commit d492cc2 ("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 <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> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent a0dd82d commit 2fadeb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/kunit/device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct kunit_device {
3535

3636
#define to_kunit_device(d) container_of_const(d, struct kunit_device, dev)
3737

38-
static struct bus_type kunit_bus_type = {
38+
static const struct bus_type kunit_bus_type = {
3939
.name = "kunit",
4040
};
4141

0 commit comments

Comments
 (0)