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.

cdx: make cdx_bus_type constant

Now that the driver core can properly handle constant struct bus_type,
move the cdx_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Nipun Gupta <nipun.gupta@amd.com>
Cc: Nikhil Agarwal <nikhil.agarwal@amd.com>
Acked-by: Nipun Gupta <nipun.gupta@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/2025091439-sustained-acorn-4af4@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+3 -3
+2 -2
drivers/cdx/cdx.c
··· 170 170 return 0; 171 171 } 172 172 173 - static void cdx_unregister_devices(struct bus_type *bus) 173 + static void cdx_unregister_devices(const struct bus_type *bus) 174 174 { 175 175 /* Reset all the devices attached to cdx bus */ 176 176 bus_for_each_dev(bus, NULL, NULL, cdx_unregister_device); ··· 651 651 }; 652 652 ATTRIBUTE_GROUPS(cdx_bus); 653 653 654 - struct bus_type cdx_bus_type = { 654 + const struct bus_type cdx_bus_type = { 655 655 .name = "cdx", 656 656 .match = cdx_bus_match, 657 657 .probe = cdx_probe,
+1 -1
include/linux/cdx/cdx_bus.h
··· 234 234 */ 235 235 void cdx_driver_unregister(struct cdx_driver *cdx_driver); 236 236 237 - extern struct bus_type cdx_bus_type; 237 + extern const struct bus_type cdx_bus_type; 238 238 239 239 /** 240 240 * cdx_dev_reset - Reset CDX device