perf/hisi: Constify static attribute_group structs
Subsystems (2)
PATCH 1/1 perf/hisi: Constify static attribute_group structs
These are only put in an array of pointers to const attribute_group structs. Make them const like the other static attribute_group structs to allow the compiler to put them in read-only memory.
Signed-off-by Rikard Falkeborn <[email protected]>
--- drivers/perf/hisilicon/hisi_uncore_pa_pmu.c | 2 +- drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/perf/hisilicon/hisi_uncore_pa_pmu.c +1 -1
@@ -333,7 +333,7 @@ static struct attribute *hisi_pa_pmu_identifier_attrs[] = { NULL }; -static struct attribute_group hisi_pa_pmu_identifier_group = { +static const struct attribute_group hisi_pa_pmu_identifier_group = { .attrs = hisi_pa_pmu_identifier_attrs, };
drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c +1 -1
@@ -366,7 +366,7 @@ static struct attribute *hisi_sllc_pmu_identifier_attrs[] = { NULL }; -static struct attribute_group hisi_sllc_pmu_identifier_group = { +static const struct attribute_group hisi_sllc_pmu_identifier_group = { .attrs = hisi_sllc_pmu_identifier_attrs, };
Signature · 1 line
2.31.1
Quoted 3 lines · Rikard Falkeborn
These are only put in an array of pointers to const
attribute_groupstructs. Make them const like the other staticattribute_groupstructs to allow the compiler to put them in read-only memory.
Applied to will (for-next/perf), thanks!
[1/1] perf/hisi: Constify static attribute_group structs
https://git.kernel.org/will/c/59d697a99daa
Cheers,
Signature · 5 lines
Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev