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.

firewire: make fw_bus_type const

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

Cc: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: linux1394-devel@lists.sourceforge.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/2023121931-skydiver-dodgy-d1bd@gregkh
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

authored by

Greg Kroah-Hartman and committed by
Takashi Sakamoto
10416a35 0dd3ee31

+2 -2
+1 -1
drivers/firewire/core-device.c
··· 219 219 return 0; 220 220 } 221 221 222 - struct bus_type fw_bus_type = { 222 + const struct bus_type fw_bus_type = { 223 223 .name = "firewire", 224 224 .match = fw_unit_match, 225 225 .probe = fw_unit_probe,
+1 -1
include/linux/firewire.h
··· 75 75 int fw_csr_iterator_next(struct fw_csr_iterator *ci, int *key, int *value); 76 76 int fw_csr_string(const u32 *directory, int key, char *buf, size_t size); 77 77 78 - extern struct bus_type fw_bus_type; 78 + extern const struct bus_type fw_bus_type; 79 79 80 80 struct fw_card_driver; 81 81 struct fw_node;