From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@alien8.de>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Kan Liang <kan.liang@linux.intel.com>,
Alexander Antonov <alexander.antonov@linux.intel.com>,
Rikard Falkeborn <rikard.falkeborn@gmail.com>
Subject: [PATCH V2 2/4] perf/x86/intel: Constify static attribute_group structs
Date: Fri, 11 Jun 2021 22:51:10 +0200 [thread overview]
Message-ID: <20210611205112.27225-3-rikard.falkeborn@gmail.com> (raw)
In-Reply-To: <20210611205112.27225-1-rikard.falkeborn@gmail.com>
These either have their address put in an array of pointers to const
attribute structs, or (in uncore_snb.c and uncore_snbep.c) have their
address assigned to at pointer to const field in the intel_uncore_type
struct.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
Changes since v1:
- None
arch/x86/events/intel/core.c | 8 ++++----
arch/x86/events/intel/cstate.c | 10 +++++-----
arch/x86/events/intel/pt.c | 4 ++--
arch/x86/events/intel/uncore_snb.c | 2 +-
arch/x86/events/intel/uncore_snbep.c | 2 +-
5 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index e28892270c58..b07d832f304e 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -5164,12 +5164,12 @@ static struct attribute_group group_events_tsx = {
.is_visible = tsx_is_visible,
};
-static struct attribute_group group_caps_gen = {
+static const struct attribute_group group_caps_gen = {
.name = "caps",
.attrs = intel_pmu_caps_attrs,
};
-static struct attribute_group group_caps_lbr = {
+static const struct attribute_group group_caps_lbr = {
.name = "caps",
.attrs = lbr_attrs,
.is_visible = lbr_is_visible,
@@ -5185,7 +5185,7 @@ static struct attribute_group group_format_extra_skl = {
.is_visible = exra_is_visible,
};
-static struct attribute_group group_default = {
+static const struct attribute_group group_default = {
.attrs = intel_pmu_attrs,
.is_visible = default_is_visible,
};
@@ -5364,7 +5364,7 @@ static struct attribute *intel_hybrid_cpus_attrs[] = {
NULL,
};
-static struct attribute_group hybrid_group_cpus = {
+static const struct attribute_group hybrid_group_cpus = {
.attrs = intel_hybrid_cpus_attrs,
};
diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c
index 433399069e27..089f71ac83f5 100644
--- a/arch/x86/events/intel/cstate.c
+++ b/arch/x86/events/intel/cstate.c
@@ -187,7 +187,7 @@ static struct attribute *attrs_empty[] = {
* "events" group (with empty attrs) before updating
* it with detected events.
*/
-static struct attribute_group core_events_attr_group = {
+static const struct attribute_group core_events_attr_group = {
.name = "events",
.attrs = attrs_empty,
};
@@ -198,7 +198,7 @@ static struct attribute *core_format_attrs[] = {
NULL,
};
-static struct attribute_group core_format_attr_group = {
+static const struct attribute_group core_format_attr_group = {
.name = "format",
.attrs = core_format_attrs,
};
@@ -211,7 +211,7 @@ static struct attribute *cstate_cpumask_attrs[] = {
NULL,
};
-static struct attribute_group cpumask_attr_group = {
+static const struct attribute_group cpumask_attr_group = {
.attrs = cstate_cpumask_attrs,
};
@@ -266,7 +266,7 @@ static struct perf_msr pkg_msr[] = {
[PERF_CSTATE_PKG_C10_RES] = { MSR_PKG_C10_RESIDENCY, &group_cstate_pkg_c10, test_msr },
};
-static struct attribute_group pkg_events_attr_group = {
+static const struct attribute_group pkg_events_attr_group = {
.name = "events",
.attrs = attrs_empty,
};
@@ -276,7 +276,7 @@ static struct attribute *pkg_format_attrs[] = {
&format_attr_pkg_event.attr,
NULL,
};
-static struct attribute_group pkg_format_attr_group = {
+static const struct attribute_group pkg_format_attr_group = {
.name = "format",
.attrs = pkg_format_attrs,
};
diff --git a/arch/x86/events/intel/pt.c b/arch/x86/events/intel/pt.c
index 915847655c06..83ccf106ed13 100644
--- a/arch/x86/events/intel/pt.c
+++ b/arch/x86/events/intel/pt.c
@@ -128,7 +128,7 @@ static struct attribute *pt_formats_attr[] = {
NULL,
};
-static struct attribute_group pt_format_group = {
+static const struct attribute_group pt_format_group = {
.name = "format",
.attrs = pt_formats_attr,
};
@@ -165,7 +165,7 @@ static struct attribute *pt_timing_attr[] = {
NULL,
};
-static struct attribute_group pt_timing_group = {
+static const struct attribute_group pt_timing_group = {
.attrs = pt_timing_attr,
};
diff --git a/arch/x86/events/intel/uncore_snb.c b/arch/x86/events/intel/uncore_snb.c
index 2938679f0002..e30b69fba939 100644
--- a/arch/x86/events/intel/uncore_snb.c
+++ b/arch/x86/events/intel/uncore_snb.c
@@ -369,7 +369,7 @@ static struct attribute *icl_uncore_clock_formats_attr[] = {
NULL,
};
-static struct attribute_group icl_uncore_clock_format_group = {
+static const struct attribute_group icl_uncore_clock_format_group = {
.name = "format",
.attrs = icl_uncore_clock_formats_attr,
};
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 43eabe8d37dc..b5b22fe473d8 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -4001,7 +4001,7 @@ static struct attribute *skx_uncore_pcu_formats_attr[] = {
NULL,
};
-static struct attribute_group skx_uncore_pcu_format_group = {
+static const struct attribute_group skx_uncore_pcu_format_group = {
.name = "format",
.attrs = skx_uncore_pcu_formats_attr,
};
--
2.32.0
next prev parent reply other threads:[~2021-06-11 20:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-11 20:51 [PATCH V2 0/4] perf/x86/intel: Constify static structs Rikard Falkeborn
2021-06-11 20:51 ` [PATCH V2 1/4] perf/x86/intel/uncore: Constify intel_uncore_ops Rikard Falkeborn
2021-06-11 20:51 ` Rikard Falkeborn [this message]
2021-06-11 20:51 ` [PATCH V2 3/4] perf/x86/intel/uncore: Constify freerunning_counters Rikard Falkeborn
2021-06-11 20:51 ` [PATCH V2 4/4] perf/x86/intel/uncore: Constify unmodified static extra_reg structs Rikard Falkeborn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210611205112.27225-3-rikard.falkeborn@gmail.com \
--to=rikard.falkeborn@gmail.com \
--cc=acme@kernel.org \
--cc=alexander.antonov@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).