From: Rikard Falkeborn Date: Wed, 30 Sep 2020 23:29:39 +0000 (+0200) Subject: iio: accel: mma8452: Constify static struct attribute_group X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=681ab2ce293638480f5395c73e5430dfd517015d;p=linux.git iio: accel: mma8452: Constify static struct attribute_group The only usage of mma8452_event_attribute_group is to assign its address to the event_attrs field in the iio_info struct, which is a const pointer. Make it const to allow the compiler to put it in read-only memory. This was the only non-const static struct in drivers/iio. Signed-off-by: Rikard Falkeborn Link: https://lore.kernel.org/r/20200930232939.31131-1-rikard.falkeborn@gmail.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index bf1d2c8afdbd7..b0176d936423d 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -1187,7 +1187,7 @@ static struct attribute *mma8452_event_attributes[] = { NULL, }; -static struct attribute_group mma8452_event_attribute_group = { +static const struct attribute_group mma8452_event_attribute_group = { .attrs = mma8452_event_attributes, };