diff options
author | Hongbo Li <[email protected]> | 2024-09-04 09:14:34 +0800 |
---|---|---|
committer | Sebastian Reichel <[email protected]> | 2024-09-05 16:30:44 +0200 |
commit | eb1ea1351da0196e355391b4aa7f8a58536f16e6 (patch) | |
tree | f1ea244e890db7513e95af171006842c0b62b37a | |
parent | 48f703d6a3d7cf345fe9c6209ea3703fe9024628 (diff) |
power: supply: ab8500: Constify struct kobj_type
This 'struct kobj_type' is not modified. It is only used in
kobject_init_and_add() which takes a 'const struct kobj_type *ktype'
parameter.
Constifying this structure and moving it to a read-only section,
and can increase over all security.
Signed-off-by: Hongbo Li <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sebastian Reichel <[email protected]>
-rw-r--r-- | drivers/power/supply/ab8500_fg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/ab8500_fg.c b/drivers/power/supply/ab8500_fg.c index 270874eeb934..a71903b1bf78 100644 --- a/drivers/power/supply/ab8500_fg.c +++ b/drivers/power/supply/ab8500_fg.c @@ -2531,7 +2531,7 @@ static struct attribute *ab8500_fg_attrs[] = { }; ATTRIBUTE_GROUPS(ab8500_fg); -static struct kobj_type ab8500_fg_ktype = { +static const struct kobj_type ab8500_fg_ktype = { .sysfs_ops = &ab8500_fg_sysfs_ops, .default_groups = ab8500_fg_groups, }; |