Skip to contentSkip to conversation

most: core: Constify static attribute_group structs

PATCH New Rikard Falkeborn 1 participant 1 message Jan 8, 2021 Most(r) technology driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 most: core: Constify static attribute_group structs

The only usage of these is to put their addresses in arrays of pointers to const attribute_groups. Make them const to allow the compiler to put them in read-only memory.

---
 drivers/most/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/most/core.c +3 -3
index 353ab277cbc6..e4412c7d25b0 100644
@@ -379,7 +379,7 @@ static struct attribute *channel_attrs[] = {
 	NULL,
 };
 
-static struct attribute_group channel_attr_group = {
+static const struct attribute_group channel_attr_group = {
 	.attrs = channel_attrs,
 	.is_visible = channel_attr_is_visible,
 };
@@ -436,7 +436,7 @@ static struct attribute *interface_attrs[] = {
 	NULL,
 };
 
-static struct attribute_group interface_attr_group = {
+static const struct attribute_group interface_attr_group = {
 	.attrs = interface_attrs,
 };
 
@@ -718,7 +718,7 @@ static struct attribute *mc_attrs[] = {
 	NULL,
 };
 
-static struct attribute_group mc_attr_group = {
+static const struct attribute_group mc_attr_group = {
 	.attrs = mc_attrs,
 };
 
Signature · 1 line
2.30.0