Skip to contentSkip to conversation

x86/events/amd/iommu: make iommu_pmu const and __initconst

PATCH New Bhumika Goyal 2 participants 2 messages Sep 19, 2017 – Oct 19, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/events/amd/iommu: make iommu_pmu const and __initconst

Make this const as it is only used during a copy operation. Also, make it __initconst as it is only used during the init phase and after this it is not referenced anywhere.

---
 arch/x86/events/amd/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/amd/iommu.c +1 -1
index 3641e24..38b5d41 100644
@@ -405,7 +405,7 @@ static __init int _init_events_attrs(void)
 	NULL,
 };
 
-static struct pmu iommu_pmu = {
+static const struct pmu iommu_pmu __initconst = {
 	.event_init	= perf_iommu_event_init,
 	.add		= perf_iommu_add,
 	.del		= perf_iommu_del,
Signature · 1 line
1.9.1
#1 lore raw

[tip:x86/cleanups] x86/events/amd/iommu: Make iommu_pmu const and __initconst

x86/events/amd/iommu: Make iommu_pmu const and __initconst
Commit-ID:  642e641cbea57e559720b9df09889ffcf525cf04
Gitweb:     https://git.kernel.org/tip/642e641cbea57e559720b9df09889ffcf525cf04
Author:     Bhumika Goyal <[email protected]>
AuthorDate: Tue, 19 Sep 2017 16:40:43 +0530
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Thu, 19 Oct 2017 16:15:47 +0200

x86/events/amd/iommu: Make iommu_pmu const and __initconst

iommu_pmu is only used as source for a copy operation in the init code path.

Mark it const and __initconst.

---
 arch/x86/events/amd/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/amd/iommu.c +1 -1
index 3641e24..38b5d41 100644
@@ -405,7 +405,7 @@ const struct attribute_group *amd_iommu_attr_groups[] = {
 	NULL,
 };
 
-static struct pmu iommu_pmu = {
+static const struct pmu iommu_pmu __initconst = {
 	.event_init	= perf_iommu_event_init,
 	.add		= perf_iommu_add,
 	.del		= perf_iommu_del,