mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
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 <lihongbo22@huawei.com> Link: https://lore.kernel.org/r/20240904011434.2010118-1-lihongbo22@huawei.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
48f703d6a3
commit
eb1ea1351d
@ -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,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user