Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

driver core: mark remaining local bus_type variables as const

Now that the driver core can properly handle constant struct bus_type,
change the local driver core bus_type variables to be a constant
structure as well, placing them into read-only memory which can not be
modified at runtime.

Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Kevin Hilman <khilman@kernel.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Len Brown <len.brown@intel.com>
Acked-by: William Breathitt Gray <william.gray@linaro.org>
Acked-by: Dave Ertman <david.m.ertman@intel.com>
Link: https://lore.kernel.org/r/2023121908-paver-follow-cc21@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+6 -6
+1 -1
drivers/base/auxiliary.c
··· 244 244 auxdrv->shutdown(auxdev); 245 245 } 246 246 247 - static struct bus_type auxiliary_bus_type = { 247 + static const struct bus_type auxiliary_bus_type = { 248 248 .name = "auxiliary", 249 249 .probe = auxiliary_bus_probe, 250 250 .remove = auxiliary_bus_remove,
+1 -1
drivers/base/isa.c
··· 82 82 return 0; 83 83 } 84 84 85 - static struct bus_type isa_bus_type = { 85 + static const struct bus_type isa_bus_type = { 86 86 .name = "isa", 87 87 .match = isa_bus_match, 88 88 .probe = isa_bus_probe,
+1 -1
drivers/base/memory.c
··· 68 68 static int memory_subsys_online(struct device *dev); 69 69 static int memory_subsys_offline(struct device *dev); 70 70 71 - static struct bus_type memory_subsys = { 71 + static const struct bus_type memory_subsys = { 72 72 .name = MEMORY_CLASS_NAME, 73 73 .dev_name = MEMORY_CLASS_NAME, 74 74 .online = memory_subsys_online,
+1 -1
drivers/base/node.c
··· 21 21 #include <linux/swap.h> 22 22 #include <linux/slab.h> 23 23 24 - static struct bus_type node_subsys = { 24 + static const struct bus_type node_subsys = { 25 25 .name = "node", 26 26 .dev_name = "node", 27 27 };
+1 -1
drivers/base/power/domain.c
··· 2670 2670 kfree(dev); 2671 2671 } 2672 2672 2673 - static struct bus_type genpd_bus_type = { 2673 + static const struct bus_type genpd_bus_type = { 2674 2674 .name = "genpd", 2675 2675 }; 2676 2676
+1 -1
drivers/base/soc.c
··· 28 28 int soc_dev_num; 29 29 }; 30 30 31 - static struct bus_type soc_bus_type = { 31 + static const struct bus_type soc_bus_type = { 32 32 .name = "soc", 33 33 }; 34 34 static bool soc_bus_registered;