[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210131133644.8834-4-rikard.falkeborn@gmail.com>
Date: Sun, 31 Jan 2021 14:36:44 +0100
From: Rikard Falkeborn <rikard.falkeborn@...il.com>
To: Lee Jones <lee.jones@...aro.org>
Cc: linux-kernel@...r.kernel.org, Tim Harvey <tharvey@...eworks.com>,
Robert Jones <rjones@...eworks.com>,
Rikard Falkeborn <rikard.falkeborn@...il.com>
Subject: [PATCH 3/3] mfd: pcf50633: Constify static struct attribute_group
The only usage of pcf_attr_group is to pass its address to
sysfs_create_group() and sysfs_remove_group(), both which takes pointers
to const attribute_group structs. Make it const to allow the compiler to
put it in read-only memory.
Done with the help of coccinelle.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@...il.com>
---
drivers/mfd/pcf50633-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
index 148bcd6120f4..0768d684113a 100644
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -131,7 +131,7 @@ static struct attribute *pcf_sysfs_entries[] = {
NULL,
};
-static struct attribute_group pcf_attr_group = {
+static const struct attribute_group pcf_attr_group = {
.name = NULL, /* put in device directory */
.attrs = pcf_sysfs_entries,
};
--
2.30.0
Powered by blists - more mailing lists