summaryrefslogtreecommitdiffstats
path: root/drivers/base/memory.c
diff options
context:
space:
mode:
authorRikard Falkeborn <rikard.falkeborn@gmail.com>2021-05-28 23:34:08 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-04 15:06:28 +0200
commit5a576764e4190f7b48cf3cf40f4294f001918605 (patch)
tree8467e31ccac33478f872e136bfe3757eea9ef670 /drivers/base/memory.c
parentfirmware_loader: remove unneeded 'comma' macro (diff)
downloadlinux-5a576764e4190f7b48cf3cf40f4294f001918605.tar.xz
linux-5a576764e4190f7b48cf3cf40f4294f001918605.zip
drivers/base: Constify static attribute_group structs
These are only used by putting their address in an array of pointers to const struct attribute_group (either directly or via the __ATTRIBUTE_GROUP macro). Make them const to allow the compiler to place them in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Link: https://lore.kernel.org/r/20210528213408.20067-1-rikard.falkeborn@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/memory.c')
-rw-r--r--drivers/base/memory.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index b31b3af5c490..600ae518c02a 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -596,7 +596,7 @@ static struct attribute *memory_memblk_attrs[] = {
NULL
};
-static struct attribute_group memory_memblk_attr_group = {
+static const struct attribute_group memory_memblk_attr_group = {
.attrs = memory_memblk_attrs,
};
@@ -772,7 +772,7 @@ static struct attribute *memory_root_attrs[] = {
NULL
};
-static struct attribute_group memory_root_attr_group = {
+static const struct attribute_group memory_root_attr_group = {
.attrs = memory_root_attrs,
};