]> www.infradead.org Git - users/dwmw2/linux.git/commit
power: supply: core: mark attribute arrays as ro_after_init
authorThomas Weißschuh <linux@weissschuh.net>
Sat, 5 Oct 2024 10:06:17 +0000 (12:06 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 16 Oct 2024 21:13:38 +0000 (23:13 +0200)
commit3120b5f218ca8e2b375d496e2ff3f4f861fbc013
tree6880dae00bd4614bdb9932ddac46ca86696de351
parentcf70da29c4993bf23df68b67a82dfa3da8234e75
power: supply: core: mark attribute arrays as ro_after_init

The attribute arrays are only modified during the __init phase.
To protect them against intentional or accidental modification,
mark them as __ro_after_init.

To make sure no modifications are introduced, also mark the return
values of the accessors as const.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20241005-power-supply-cleanups-v1-3-45303b2d0a4d@weissschuh.net
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/power_supply.h
drivers/power/supply/power_supply_sysfs.c