perf: Constify static struct attribute_group
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Sun, 17 Jan 2021 21:28:47 +0000 (22:28 +0100)
committerWill Deacon <will@kernel.org>
Wed, 20 Jan 2021 17:51:23 +0000 (17:51 +0000)
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-5-rikard.falkeborn@gmail.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm-cci.c
drivers/perf/arm-cmn.c
drivers/perf/arm_dmc620_pmu.c
drivers/perf/arm_pmu.c
drivers/perf/arm_smmuv3_pmu.c
drivers/perf/arm_spe_pmu.c

index 87c4be9dd41251cc20287e9f336ad99c1be192ec..a75cf77c4de4cdd4a715c0b1e73d27920ea58bbf 100644 (file)
@@ -1376,7 +1376,7 @@ static struct attribute *pmu_attrs[] = {
        NULL,
 };
 
-static struct attribute_group pmu_attr_group = {
+static const struct attribute_group pmu_attr_group = {
        .attrs = pmu_attrs,
 };
 
index a76ff594f3ca41743e3f0d94e01be22955c0b36e..f30fcd330899431a82aa3c9fc64f67e3b80416a6 100644 (file)
@@ -616,7 +616,7 @@ static struct attribute *arm_cmn_cpumask_attrs[] = {
        NULL,
 };
 
-static struct attribute_group arm_cmn_cpumask_attr_group = {
+static const struct attribute_group arm_cmn_cpumask_attr_group = {
        .attrs = arm_cmn_cpumask_attrs,
 };
 
index 004930eb4bbb6d01abe367e10969b4d0da565d48..27f54c0afc3b2c5448575044315e3bddbad0daf3 100644 (file)
@@ -159,7 +159,7 @@ static struct attribute *dmc620_pmu_events_attrs[] = {
        NULL,
 };
 
-static struct attribute_group dmc620_pmu_events_attr_group = {
+static const struct attribute_group dmc620_pmu_events_attr_group = {
        .name = "events",
        .attrs = dmc620_pmu_events_attrs,
 };
@@ -222,7 +222,7 @@ static struct attribute *dmc620_pmu_formats_attrs[] = {
        NULL,
 };
 
-static struct attribute_group dmc620_pmu_format_attr_group = {
+static const struct attribute_group dmc620_pmu_format_attr_group = {
        .name   = "format",
        .attrs  = dmc620_pmu_formats_attrs,
 };
index cb2f55f450e4adf05a7b3d81e8b9a01230665584..2d10d84fb79c4d8c1e9de98f9edf3f3674fb7b66 100644 (file)
@@ -577,7 +577,7 @@ static struct attribute *armpmu_common_attrs[] = {
        NULL,
 };
 
-static struct attribute_group armpmu_common_attr_group = {
+static const struct attribute_group armpmu_common_attr_group = {
        .attrs = armpmu_common_attrs,
 };
 
index 74474bb322c3f2618940a15557b14651b848e41c..8ff7a67f691cf93b9d9576af74bce580a06317f3 100644 (file)
@@ -493,7 +493,7 @@ static struct attribute *smmu_pmu_cpumask_attrs[] = {
        NULL
 };
 
-static struct attribute_group smmu_pmu_cpumask_group = {
+static const struct attribute_group smmu_pmu_cpumask_group = {
        .attrs = smmu_pmu_cpumask_attrs,
 };
 
@@ -548,7 +548,7 @@ static umode_t smmu_pmu_event_is_visible(struct kobject *kobj,
        return 0;
 }
 
-static struct attribute_group smmu_pmu_events_group = {
+static const struct attribute_group smmu_pmu_events_group = {
        .name = "events",
        .attrs = smmu_pmu_events,
        .is_visible = smmu_pmu_event_is_visible,
@@ -583,7 +583,7 @@ static struct attribute *smmu_pmu_identifier_attrs[] = {
        NULL
 };
 
-static struct attribute_group smmu_pmu_identifier_group = {
+static const struct attribute_group smmu_pmu_identifier_group = {
        .attrs = smmu_pmu_identifier_attrs,
        .is_visible = smmu_pmu_identifier_attr_visible,
 };
@@ -602,7 +602,7 @@ static struct attribute *smmu_pmu_formats[] = {
        NULL
 };
 
-static struct attribute_group smmu_pmu_format_group = {
+static const struct attribute_group smmu_pmu_format_group = {
        .name = "format",
        .attrs = smmu_pmu_formats,
 };
index bce9aff9f546f2ea63313eb0817f1af568b5f251..d3929ccebfd2fa1dbea1d83dbb1c196d086d5781 100644 (file)
@@ -146,7 +146,7 @@ static struct attribute *arm_spe_pmu_cap_attr[] = {
        NULL,
 };
 
-static struct attribute_group arm_spe_pmu_cap_group = {
+static const struct attribute_group arm_spe_pmu_cap_group = {
        .name   = "caps",
        .attrs  = arm_spe_pmu_cap_attr,
 };
@@ -227,7 +227,7 @@ static struct attribute *arm_spe_pmu_formats_attr[] = {
        NULL,
 };
 
-static struct attribute_group arm_spe_pmu_format_group = {
+static const struct attribute_group arm_spe_pmu_format_group = {
        .name   = "format",
        .attrs  = arm_spe_pmu_formats_attr,
 };
@@ -247,7 +247,7 @@ static struct attribute *arm_spe_pmu_attrs[] = {
        NULL,
 };
 
-static struct attribute_group arm_spe_pmu_group = {
+static const struct attribute_group arm_spe_pmu_group = {
        .attrs  = arm_spe_pmu_attrs,
 };