mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
driver core: cpu: make cpu_subsys const
Now that the driver core can properly handle constant struct bus_type, move the cpu_subsys variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: "Rafael J. Wysocki" <rafael@kernel.org> Link: https://lore.kernel.org/r/2024010548-crane-snooze-a871@gregkh Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
05d8f25586
commit
3a480d4bb5
|
|
@ -366,7 +366,7 @@ static int cpu_uevent(const struct device *dev, struct kobj_uevent_env *env)
|
|||
}
|
||||
#endif
|
||||
|
||||
struct bus_type cpu_subsys = {
|
||||
const struct bus_type cpu_subsys = {
|
||||
.name = "cpu",
|
||||
.dev_name = "cpu",
|
||||
.match = cpu_subsys_match,
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ static inline void cpu_maps_update_done(void)
|
|||
static inline int add_cpu(unsigned int cpu) { return 0;}
|
||||
|
||||
#endif /* CONFIG_SMP */
|
||||
extern struct bus_type cpu_subsys;
|
||||
extern const struct bus_type cpu_subsys;
|
||||
|
||||
extern int lockdep_is_cpus_held(void);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user