Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

parisc: pdc_stable: 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>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Hongbo Li and committed by
Helge Deller
75df38aa da3ea350

+1 -1
+1 -1
drivers/parisc/pdc_stable.c
··· 483 483 ATTRIBUTE_GROUPS(paths_subsys); 484 484 485 485 /* Specific kobject type for our PDC paths */ 486 - static struct kobj_type ktype_pdcspath = { 486 + static const struct kobj_type ktype_pdcspath = { 487 487 .sysfs_ops = &pdcspath_attr_ops, 488 488 .default_groups = paths_subsys_groups, 489 489 };