Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753945AbdGCKQE (ORCPT ); Mon, 3 Jul 2017 06:16:04 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35997 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752911AbdGCKQB (ORCPT ); Mon, 3 Jul 2017 06:16:01 -0400 From: Arvind Yadav To: mchehab@kernel.org, bp@alien8.de Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] edac: i7core: constify attribute_group structures. Date: Mon, 3 Jul 2017 15:45:46 +0530 Message-Id: <401bf1117576dabddbe30bab2ee3f8f64fad097c.1499076872.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1305 Lines: 41 attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by 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 --- 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