From: Rikard Falkeborn Date: Sun, 17 Jan 2021 22:16:22 +0000 (+0100) Subject: soundwire: sysfs: Constify static struct attribute_group X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=565e3afaefee3cfe13783c2b1e8d5ceb09023beb;p=linux.git soundwire: sysfs: Constify static struct attribute_group The only place sdw_slave_dev_attr_group is used is when its address is passed to devm_device_add_group() which takes a pointer to const struct attribute_group. Make it const to allow the compiler to put it in read-only memory. This makes all attribute_group structs in the file const. Done with the help of Coccinelle. Signed-off-by: Rikard Falkeborn Link: https://lore.kernel.org/r/20210117221622.34315-1-rikard.falkeborn@gmail.com Signed-off-by: Vinod Koul --- diff --git a/drivers/soundwire/sysfs_slave.c b/drivers/soundwire/sysfs_slave.c index b48b6617a3964..3210359cd9442 100644 --- a/drivers/soundwire/sysfs_slave.c +++ b/drivers/soundwire/sysfs_slave.c @@ -130,7 +130,7 @@ static struct attribute *slave_dev_attrs[] = { * we don't use ATTRIBUTES_GROUP here since we want to add a subdirectory * for device-level properties */ -static struct attribute_group sdw_slave_dev_attr_group = { +static const struct attribute_group sdw_slave_dev_attr_group = { .attrs = slave_dev_attrs, .name = "dev-properties", };