Skip to contentSkip to conversation

perf/pt: Annotate pt_cap_group with __ro_after_init

PATCH In review Zubin Mithra 3 participants 3 messages Sep 12, 2018

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

PATCH 1/1 perf/pt: Annotate pt_cap_group with __ro_after_init

pt_cap_group is written to in pt_pmu_hw_init and not modified after. This makes it a suitable candidate for annotating as __ro_after_init.

---
 arch/x86/events/intel/pt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/pt.c +1 -1
index 8d016ce5b80d..3a0aa83cbd07 100644
@@ -95,7 +95,7 @@ static ssize_t pt_cap_show(struct device *cdev,
 	return snprintf(buf, PAGE_SIZE, "%x\n", pt_cap_get(cap));
 }
 
-static struct attribute_group pt_cap_group = {
+static struct attribute_group pt_cap_group __ro_after_init = {
 	.name	= "caps",
 };
 
Signature · 1 line
2.18.0.597.ga71716f1ad-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Zubin Mithra

pt_cap_group is written to in pt_pmu_hw_init and not modified after. This makes it a suitable candidate for annotating as __ro_after_init.

Quoted 20 lines
---
 arch/x86/events/intel/pt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/pt.c +1 -2
index 8d016ce5b80d..3a0aa83cbd07 100644
@@ -95,7 +95,7 @@ static ssize_t pt_cap_show(struct device *cdev,
        return snprintf(buf, PAGE_SIZE, "%x\n", pt_cap_get(cap));
 }
 
-static struct attribute_group pt_cap_group = {
+static struct attribute_group pt_cap_group __ro_after_init = {
        .name   = "caps",
 };
 
--

2.18.0.597.ga71716f1ad-goog

#2 lore raw

[tip:perf/core] perf/x86/intel/pt: Annotate 'pt_cap_group' with __ro_after_init

In reply to Zubin Mithra
perf/x86/intel/pt: Annotate 'pt_cap_group' with __ro_after_init
Commit-ID:  49e73246cbe6fe0df9cae2db87f31cdc3a0b2b61
Gitweb:     https://git.kernel.org/tip/49e73246cbe6fe0df9cae2db87f31cdc3a0b2b61
Author:     Zubin Mithra <[email protected]>
AuthorDate: Wed, 12 Sep 2018 09:45:10 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 12 Sep 2018 21:16:16 +0200

perf/x86/intel/pt: Annotate 'pt_cap_group' with __ro_after_init

'pt_cap_group' is written to in pt_pmu_hw_init() and not modified after. This makes it a suitable candidate for annotating as __ro_after_init.

---
 arch/x86/events/intel/pt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/pt.c +1 -1
index 8d016ce5b80d..3a0aa83cbd07 100644
@@ -95,7 +95,7 @@ static ssize_t pt_cap_show(struct device *cdev,
 	return snprintf(buf, PAGE_SIZE, "%x\n", pt_cap_get(cap));
 }
 
-static struct attribute_group pt_cap_group = {
+static struct attribute_group pt_cap_group __ro_after_init = {
 	.name	= "caps",
 };