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

perf: qcom: 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-2-rikard.falkeborn@gmail.com
Signed-off-by: Will Deacon <will@kernel.org>

authored by

Rikard Falkeborn and committed by
Will Deacon
30b34c48 4a669e24

+6 -6
+3 -3
drivers/perf/qcom_l2_pmu.c
··· 649 649 NULL, 650 650 }; 651 651 652 - static struct attribute_group l2_cache_pmu_cpumask_group = { 652 + static const struct attribute_group l2_cache_pmu_cpumask_group = { 653 653 .attrs = l2_cache_pmu_cpumask_attrs, 654 654 }; 655 655 ··· 665 665 NULL, 666 666 }; 667 667 668 - static struct attribute_group l2_cache_pmu_format_group = { 668 + static const struct attribute_group l2_cache_pmu_format_group = { 669 669 .name = "format", 670 670 .attrs = l2_cache_pmu_formats, 671 671 }; ··· 700 700 NULL 701 701 }; 702 702 703 - static struct attribute_group l2_cache_pmu_events_group = { 703 + static const struct attribute_group l2_cache_pmu_events_group = { 704 704 .name = "events", 705 705 .attrs = l2_cache_pmu_events, 706 706 };
+3 -3
drivers/perf/qcom_l3_pmu.c
··· 630 630 NULL, 631 631 }; 632 632 633 - static struct attribute_group qcom_l3_cache_pmu_format_group = { 633 + static const struct attribute_group qcom_l3_cache_pmu_format_group = { 634 634 .name = "format", 635 635 .attrs = qcom_l3_cache_pmu_formats, 636 636 }; ··· 663 663 NULL 664 664 }; 665 665 666 - static struct attribute_group qcom_l3_cache_pmu_events_group = { 666 + static const struct attribute_group qcom_l3_cache_pmu_events_group = { 667 667 .name = "events", 668 668 .attrs = qcom_l3_cache_pmu_events, 669 669 }; ··· 685 685 NULL, 686 686 }; 687 687 688 - static struct attribute_group qcom_l3_cache_pmu_cpumask_attr_group = { 688 + static const struct attribute_group qcom_l3_cache_pmu_cpumask_attr_group = { 689 689 .attrs = qcom_l3_cache_pmu_cpumask_attrs, 690 690 }; 691 691