Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1692826
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 7/7] x86: microcode: constify attribute_group structures. |
| Date | 2017-07-20 13:40 +0200 |
| Message-ID | <u5hYd-6H9-1@gated-at.bofh.it> (permalink) |
| References | <u5hYd-6H9-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
change in v2:
Remove before/after size comparison from commit message.
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
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH v2 7/7] x86: microcode: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-20 13:40 +0200
csiph-web