Skip to content

Commit

Permalink
perf/x86: Make more stuff static
Browse files Browse the repository at this point in the history
When building with C=2, sparse makes note of a number of things:

  arch/x86/events/intel/rapl.c:637:30: warning: symbol 'rapl_attr_update' was not declared. Should it be static?
  arch/x86/events/intel/cstate.c:449:30: warning: symbol 'core_attr_update' was not declared. Should it be static?
  arch/x86/events/intel/cstate.c:457:30: warning: symbol 'pkg_attr_update' was not declared. Should it be static?
  arch/x86/events/msr.c:170:30: warning: symbol 'attr_update' was not declared. Should it be static?
  arch/x86/events/intel/lbr.c:276:1: warning: symbol 'lbr_from_quirk_key' was not declared. Should it be static?

And they can all indeed be static.

Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/128059.1565286242@turing-police
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Valdis Klētnieks authored and Ingo Molnar committed Sep 3, 2019
1 parent 7720804 commit d9f3b45
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions arch/x86/events/intel/cstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,15 +446,15 @@ static int cstate_cpu_init(unsigned int cpu)
return 0;
}

const struct attribute_group *core_attr_update[] = {
static const struct attribute_group *core_attr_update[] = {
&group_cstate_core_c1,
&group_cstate_core_c3,
&group_cstate_core_c6,
&group_cstate_core_c7,
NULL,
};

const struct attribute_group *pkg_attr_update[] = {
static const struct attribute_group *pkg_attr_update[] = {
&group_cstate_pkg_c2,
&group_cstate_pkg_c3,
&group_cstate_pkg_c6,
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/events/intel/lbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ static inline bool lbr_from_signext_quirk_needed(void)
return !tsx_support && (lbr_desc[lbr_format] & LBR_TSX);
}

DEFINE_STATIC_KEY_FALSE(lbr_from_quirk_key);
static DEFINE_STATIC_KEY_FALSE(lbr_from_quirk_key);

/* If quirk is enabled, ensure sign extension is 63 bits: */
inline u64 lbr_from_signext_quirk_wr(u64 val)
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/events/intel/rapl.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ static void cleanup_rapl_pmus(void)
kfree(rapl_pmus);
}

const struct attribute_group *rapl_attr_update[] = {
static const struct attribute_group *rapl_attr_update[] = {
&rapl_events_cores_group,
&rapl_events_pkg_group,
&rapl_events_ram_group,
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/events/msr.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static const struct attribute_group *attr_groups[] = {
NULL,
};

const struct attribute_group *attr_update[] = {
static const struct attribute_group *attr_update[] = {
&group_aperf,
&group_mperf,
&group_pperf,
Expand Down

0 comments on commit d9f3b45

Please sign in to comment.