]> git.baikalelectronics.ru Git - kernel.git/commit
soundwire: sysfs: Constify static struct attribute_group
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Sun, 17 Jan 2021 22:16:22 +0000 (23:16 +0100)
committerVinod Koul <vkoul@kernel.org>
Tue, 19 Jan 2021 14:51:20 +0000 (20:21 +0530)
commit81e739725ef59a44db7e4fac6b444ee3b2a44011
tree6143909e2a208f70b840196b96c1221949f4a18d
parent4fc8bcbd7820a8a73998ad3812b907678040bbda
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 <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210117221622.34315-1-rikard.falkeborn@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/sysfs_slave.c