[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1500535305-9369-8-git-send-email-arvind.yadav.cs@gmail.com>
Date: Thu, 20 Jul 2017 12:51:45 +0530
From: Arvind Yadav <arvind.yadav.cs@...il.com>
To: tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
x86@...nel.org, bp@...en8.de, tony.luck@...el.com
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH 7/7] x86: microcode: constify attribute_group structures.
attribute_group are not supposed to change at runtime. All functions
working with attribute_group 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
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 <arvind.yadav.cs@...il.com>
---
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
Powered by blists - more mailing lists