Commit 5a576764 authored by Rikard Falkeborn's avatar Rikard Falkeborn Committed by Greg Kroah-Hartman
Browse files

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: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210528213408.20067-1-rikard.falkeborn@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7f787701
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -175,7 +175,7 @@ static struct attribute *crash_note_cpu_attrs[] = {
	NULL
	NULL
};
};


static struct attribute_group crash_note_cpu_attr_group = {
static const struct attribute_group crash_note_cpu_attr_group = {
	.attrs = crash_note_cpu_attrs,
	.attrs = crash_note_cpu_attrs,
};
};
#endif
#endif
@@ -475,7 +475,7 @@ static struct attribute *cpu_root_attrs[] = {
	NULL
	NULL
};
};


static struct attribute_group cpu_root_attr_group = {
static const struct attribute_group cpu_root_attr_group = {
	.attrs = cpu_root_attrs,
	.attrs = cpu_root_attrs,
};
};


+2 −2
Original line number Original line Diff line number Diff line
@@ -596,7 +596,7 @@ static struct attribute *memory_memblk_attrs[] = {
	NULL
	NULL
};
};


static struct attribute_group memory_memblk_attr_group = {
static const struct attribute_group memory_memblk_attr_group = {
	.attrs = memory_memblk_attrs,
	.attrs = memory_memblk_attrs,
};
};


@@ -772,7 +772,7 @@ static struct attribute *memory_root_attrs[] = {
	NULL
	NULL
};
};


static struct attribute_group memory_root_attr_group = {
static const struct attribute_group memory_root_attr_group = {
	.attrs = memory_root_attrs,
	.attrs = memory_root_attrs,
};
};


+1 −1
Original line number Original line Diff line number Diff line
@@ -1036,7 +1036,7 @@ static struct attribute *node_state_attrs[] = {
	NULL
	NULL
};
};


static struct attribute_group memory_root_attr_group = {
static const struct attribute_group memory_root_attr_group = {
	.attrs = node_state_attrs,
	.attrs = node_state_attrs,
};
};


+1 −1
Original line number Original line Diff line number Diff line
@@ -1335,7 +1335,7 @@ static umode_t platform_dev_attrs_visible(struct kobject *kobj, struct attribute
	return a->mode;
	return a->mode;
}
}


static struct attribute_group platform_dev_group = {
static const struct attribute_group platform_dev_group = {
	.attrs = platform_dev_attrs,
	.attrs = platform_dev_attrs,
	.is_visible = platform_dev_attrs_visible,
	.is_visible = platform_dev_attrs_visible,
};
};