Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43b9e4fe authored by Mukesh Ojha's avatar Mukesh Ojha Committed by Ingo Molnar
Browse files

perf/core: Declare the __percpu attribute on non-deref types



Sparse reports the current declaration of two perf percpu variables
with this warning:

  warning: incorrect type in initializer (different address spaces)
         expected void const [noderef] <asn:3>*__vpp_verify
         got struct perf_cpu_context *<noident>

While it's normally perfectly fine to place GCC attributes anywhere
in the definition, this particular attribute is for a checking
compiler's such as Sparse's benefit, which doesn't want __percpu
on pointers.

So reorder the attribute to come after the structure type, not after
the pointer type.

[ mingo: Rewrote the changelog. ]

Signed-off-by: default avatarMukesh Ojha <mojha@codeaurora.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/1543310012-7967-1-git-send-email-mojha@codeaurora.org


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent fca0c116
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -262,8 +262,8 @@ struct pmu {
	 */
	int				capabilities;

	int * __percpu			pmu_disable_count;
	struct perf_cpu_context * __percpu pmu_cpu_context;
	int __percpu			*pmu_disable_count;
	struct perf_cpu_context __percpu *pmu_cpu_context;
	atomic_t			exclusive_cnt; /* < 0: cpu; > 0: tsk */
	int				task_ctx_nr;
	int				hrtimer_interval_ms;