[PATCH 6/7] x86: therm_throt: constify attribute_group structures.
From: Arvind Yadav
Date: Thu Jul 20 2017 - 03:23:32 EST
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
3586 864 32 4482 1182 x86/kernel/cpu/mcheck/therm_throt.o
File size After adding 'const':
text data bss dec hex filename
3550 928 32 4482 1182 x86/kernel/cpu/mcheck/therm_throt.o
Signed-off-by: Arvind Yadav <arvind.yadav.cs@xxxxxxxxx>
---
arch/x86/kernel/cpu/mcheck/therm_throt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index d7cc190..f7370ab 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -122,7 +122,7 @@ struct thermal_state {
NULL
};
-static struct attribute_group thermal_attr_group = {
+static const struct attribute_group thermal_attr_group = {
.attrs = thermal_throttle_attrs,
.name = "thermal_throttle"
};
--
1.9.1