attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const.
File size before: text data bss dec hex filename 12589 1216 8 13813 35f5 drivers/edac/i7core_edac.o File size After adding 'const': text data bss dec hex filename 12717 1088 8 13813 35f5 drivers/edac/i7core_edac.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/edac/i7core_edac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 75ad847..ba0fa11 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -1079,7 +1079,7 @@ static ssize_t i7core_inject_enable_show(struct device *dev, NULL }; -static struct attribute_group addrmatch_grp = { +static const struct attribute_group addrmatch_grp = { .attrs = i7core_addrmatch_attrs, }; @@ -1110,7 +1110,7 @@ static void addrmatch_release(struct device *device) NULL }; -static struct attribute_group all_channel_counts_grp = { +static const struct attribute_group all_channel_counts_grp = { .attrs = i7core_udimm_counters_attrs, }; -- 1.9.1