diff mbox series

powerpc/perf: Fix power_pmu_wants_prompt_pmi to be defined only for CONFIG_PPC64

Message ID 20220114031355.87480-1-atrajeev@linux.vnet.ibm.com (mailing list archive)
State Accepted
Headers show
Series powerpc/perf: Fix power_pmu_wants_prompt_pmi to be defined only for CONFIG_PPC64 | expand

Checks

Context Check Description
snowpatch_ozlabs/github-powerpc_ppctests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_selftests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_clang success Successfully ran 7 jobs.
snowpatch_ozlabs/github-powerpc_sparse warning sparse (pmac32, ubuntu-21.04, ppc64) found 1 issues.
snowpatch_ozlabs/github-powerpc_kernel_qemu success Successfully ran 24 jobs.

Commit Message

Athira Rajeev Jan. 14, 2022, 3:13 a.m. UTC
power_pmu_wants_prompt_pmi is used to decide if PMI should
be taken prompt. This is valid only for ppc64 and is used
in CONFIG_PPC_BOOK3S_64 context. Hence include the function
under config check for PPC64

Fixes warning for 32-bit compilation:

>> arch/powerpc/perf/core-book3s.c:2455:6: warning: no previous prototype for 'power_pmu_wants_prompt_pmi' [-Wmissing-prototypes]
    2455 | bool power_pmu_wants_prompt_pmi(void)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: 5a7745b96f43 ("powerpc/64s/perf: add power_pmu_wants_prompt_pmi to say whether perf wants PMIs to be soft-NMI")
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
---
Note: Address compilation warning reported here:
 https://lore.kernel.org/lkml/202112220137.X16y07Dp-lkp@intel.com/ 
Patch is based on powerpc/merge

 arch/powerpc/perf/core-book3s.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Michael Ellerman Jan. 19, 2022, 11:06 a.m. UTC | #1
On Fri, 14 Jan 2022 08:43:55 +0530, Athira Rajeev wrote:
> power_pmu_wants_prompt_pmi is used to decide if PMI should
> be taken prompt. This is valid only for ppc64 and is used
> in CONFIG_PPC_BOOK3S_64 context. Hence include the function
> under config check for PPC64
> 
> Fixes warning for 32-bit compilation:
> 
> [...]

Applied to powerpc/fixes.

[1/1] powerpc/perf: Fix power_pmu_wants_prompt_pmi to be defined only for CONFIG_PPC64
      https://git.kernel.org/powerpc/c/429a64f6e91fbfe4912d17247c27d0d66767b1c2

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index a684901b6965..b7160fae58c6 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -2452,6 +2452,7 @@  static void perf_event_interrupt(struct pt_regs *regs)
  * could possibly return false if only events are being counted rather than
  * samples being taken, but for now this is good enough.
  */
+#ifdef CONFIG_PPC64
 bool power_pmu_wants_prompt_pmi(void)
 {
 	struct cpu_hw_events *cpuhw;
@@ -2467,6 +2468,7 @@  bool power_pmu_wants_prompt_pmi(void)
 	cpuhw = this_cpu_ptr(&cpu_hw_events);
 	return cpuhw->n_events;
 }
+#endif
 
 static int power_pmu_prepare_cpu(unsigned int cpu)
 {