Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf/imx_ddr: Constify static struct attribute_group

The only usage is to put their addresses in an array of pointers to
const struct attribute group. Make them const to allow the compiler
to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210117212847.21319-3-rikard.falkeborn@gmail.com
Signed-off-by: Will Deacon <will@kernel.org>

authored by

Rikard Falkeborn and committed by
Will Deacon
3cb7d2da 30b34c48

+5 -5
+5 -5
drivers/perf/fsl_imx8_ddr_perf.c
··· 133 133 NULL, 134 134 }; 135 135 136 - static struct attribute_group ddr_perf_identifier_attr_group = { 136 + static const struct attribute_group ddr_perf_identifier_attr_group = { 137 137 .attrs = ddr_perf_identifier_attrs, 138 138 .is_visible = ddr_perf_identifier_attr_visible, 139 139 }; ··· 188 188 NULL, 189 189 }; 190 190 191 - static struct attribute_group ddr_perf_filter_cap_attr_group = { 191 + static const struct attribute_group ddr_perf_filter_cap_attr_group = { 192 192 .name = "caps", 193 193 .attrs = ddr_perf_filter_cap_attr, 194 194 }; ··· 209 209 NULL, 210 210 }; 211 211 212 - static struct attribute_group ddr_perf_cpumask_attr_group = { 212 + static const struct attribute_group ddr_perf_cpumask_attr_group = { 213 213 .attrs = ddr_perf_cpumask_attrs, 214 214 }; 215 215 ··· 265 265 NULL, 266 266 }; 267 267 268 - static struct attribute_group ddr_perf_events_attr_group = { 268 + static const struct attribute_group ddr_perf_events_attr_group = { 269 269 .name = "events", 270 270 .attrs = ddr_perf_events_attrs, 271 271 }; ··· 281 281 NULL, 282 282 }; 283 283 284 - static struct attribute_group ddr_perf_format_attr_group = { 284 + static const struct attribute_group ddr_perf_format_attr_group = { 285 285 .name = "format", 286 286 .attrs = ddr_perf_format_attrs, 287 287 };