Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934341AbdGTHWw (ORCPT ); Thu, 20 Jul 2017 03:22:52 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34528 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934281AbdGTHWs (ORCPT ); Thu, 20 Jul 2017 03:22:48 -0400 From: Arvind Yadav To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, bp@alien8.de, tony.luck@intel.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH 7/7] x86: microcode: constify attribute_group structures. Date: Thu, 20 Jul 2017 12:51:45 +0530 Message-Id: <1500535305-9369-8-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500535305-9369-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1500535305-9369-1-git-send-email-arvind.yadav.cs@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1376 Lines: 41 attribute_group are not supposed to change at runtime. All functions working with attribute_group provided by work with const attribute_group. So mark the non-const structs as const. File size before: text data bss dec hex filename 3614 545 1560 5719 1657 x86/kernel/cpu/microcode/core.o File size After adding 'const': text data bss dec hex filename 3742 417 1560 5719 1657 x86/kernel/cpu/microcode/core.o Signed-off-by: Arvind Yadav --- arch/x86/kernel/cpu/microcode/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index 9cb98ee..86e8f0b 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -561,7 +561,7 @@ static ssize_t pf_show(struct device *dev, NULL }; -static struct attribute_group mc_attr_group = { +static const struct attribute_group mc_attr_group = { .attrs = mc_default_attrs, .name = "microcode", }; @@ -707,7 +707,7 @@ static int mc_cpu_down_prep(unsigned int cpu) NULL }; -static struct attribute_group cpu_root_microcode_group = { +static const struct attribute_group cpu_root_microcode_group = { .name = "microcode", .attrs = cpu_root_microcode_attrs, }; -- 1.9.1