Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754127AbdGCKjv (ORCPT ); Mon, 3 Jul 2017 06:39:51 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34149 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754110AbdGCKjs (ORCPT ); Mon, 3 Jul 2017 06:39:48 -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: constify attribute_group structures. Date: Mon, 3 Jul 2017 16:09:33 +0530 Message-Id: <776cb8265509054abd01b0b551624cc0da3b88e7.1499078335.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: 1530 Lines: 50 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 6026 2541 12 8579 2183 drivers/edac/edac_mc_sysfs.o File size After adding 'const': text data bss dec hex filename 6090 2477 12 8579 2183 drivers/edac/edac_mc_sysfs.o Signed-off-by: Arvind Yadav --- drivers/edac/edac_mc_sysfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 445862d..dbc6446 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c @@ -287,7 +287,7 @@ static ssize_t channel_ce_count_show(struct device *dev, NULL, }; -static struct attribute_group csrow_attr_grp = { +static const struct attribute_group csrow_attr_grp = { .attrs = csrow_attrs, }; @@ -627,7 +627,7 @@ static DEVICE_ATTR(dimm_label, S_IRUGO | S_IWUSR, NULL, }; -static struct attribute_group dimm_attr_grp = { +static const struct attribute_group dimm_attr_grp = { .attrs = dimm_attrs, }; @@ -902,7 +902,7 @@ static umode_t mci_attr_is_visible(struct kobject *kobj, return mode; } -static struct attribute_group mci_attr_grp = { +static const struct attribute_group mci_attr_grp = { .attrs = mci_attrs, .is_visible = mci_attr_is_visible, }; -- 1.9.1