[PATCH 2/2] powerpc/perf: Add declarations to fix sparse warnings
Madhavan Srinivasan
maddy at linux.ibm.com
Thu Sep 17 14:30:52 AEST 2020
On 9/16/20 5:26 PM, Michael Ellerman wrote:
> Sparse warns about all the init functions:
> symbol init_ppc970_pmu was not declared. Should it be static?
> symbol init_power5p_pmu was not declared. Should it be static?
> symbol init_power5_pmu was not declared. Should it be static?
> symbol init_power6_pmu was not declared. Should it be static?
> symbol init_power7_pmu was not declared. Should it be static?
> symbol init_power9_pmu was not declared. Should it be static?
> symbol init_power8_pmu was not declared. Should it be static?
> symbol init_generic_compat_pmu was not declared. Should it be static?
>
> They're already declared in internal.h, so just make sure all the C
> files include that directly or indirectly.
Reviewed-by: Madhavan Srinivasan <maddy at linux.ibm.com>
> Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
> ---
> arch/powerpc/perf/isa207-common.h | 2 ++
> arch/powerpc/perf/power10-pmu.c | 1 -
> arch/powerpc/perf/power5+-pmu.c | 2 ++
> arch/powerpc/perf/power5-pmu.c | 2 ++
> arch/powerpc/perf/power6-pmu.c | 2 ++
> arch/powerpc/perf/power7-pmu.c | 2 ++
> arch/powerpc/perf/ppc970-pmu.c | 2 ++
> 7 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/perf/isa207-common.h b/arch/powerpc/perf/isa207-common.h
> index 044de65e96b9..7025de5e60e7 100644
> --- a/arch/powerpc/perf/isa207-common.h
> +++ b/arch/powerpc/perf/isa207-common.h
> @@ -13,6 +13,8 @@
> #include <asm/firmware.h>
> #include <asm/cputable.h>
>
> +#include "internal.h"
> +
> #define EVENT_EBB_MASK 1ull
> #define EVENT_EBB_SHIFT PERF_EVENT_CONFIG_EBB_SHIFT
> #define EVENT_BHRB_MASK 1ull
> diff --git a/arch/powerpc/perf/power10-pmu.c b/arch/powerpc/perf/power10-pmu.c
> index 83148656b524..9dbe8f9b89b4 100644
> --- a/arch/powerpc/perf/power10-pmu.c
> +++ b/arch/powerpc/perf/power10-pmu.c
> @@ -9,7 +9,6 @@
> #define pr_fmt(fmt) "power10-pmu: " fmt
>
> #include "isa207-common.h"
> -#include "internal.h"
>
> /*
> * Raw event encoding for Power10:
> diff --git a/arch/powerpc/perf/power5+-pmu.c b/arch/powerpc/perf/power5+-pmu.c
> index a62b2cd7914f..3e64b4a1511f 100644
> --- a/arch/powerpc/perf/power5+-pmu.c
> +++ b/arch/powerpc/perf/power5+-pmu.c
> @@ -10,6 +10,8 @@
> #include <asm/reg.h>
> #include <asm/cputable.h>
>
> +#include "internal.h"
> +
> /*
> * Bits in event code for POWER5+ (POWER5 GS) and POWER5++ (POWER5 GS DD3)
> */
> diff --git a/arch/powerpc/perf/power5-pmu.c b/arch/powerpc/perf/power5-pmu.c
> index 8732b587cf71..017bb19b73fb 100644
> --- a/arch/powerpc/perf/power5-pmu.c
> +++ b/arch/powerpc/perf/power5-pmu.c
> @@ -10,6 +10,8 @@
> #include <asm/reg.h>
> #include <asm/cputable.h>
>
> +#include "internal.h"
> +
> /*
> * Bits in event code for POWER5 (not POWER5++)
> */
> diff --git a/arch/powerpc/perf/power6-pmu.c b/arch/powerpc/perf/power6-pmu.c
> index 0e318cf87129..189974478e9f 100644
> --- a/arch/powerpc/perf/power6-pmu.c
> +++ b/arch/powerpc/perf/power6-pmu.c
> @@ -10,6 +10,8 @@
> #include <asm/reg.h>
> #include <asm/cputable.h>
>
> +#include "internal.h"
> +
> /*
> * Bits in event code for POWER6
> */
> diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c
> index 5e0bf09cf077..bacfab104a1a 100644
> --- a/arch/powerpc/perf/power7-pmu.c
> +++ b/arch/powerpc/perf/power7-pmu.c
> @@ -10,6 +10,8 @@
> #include <asm/reg.h>
> #include <asm/cputable.h>
>
> +#include "internal.h"
> +
> /*
> * Bits in event code for POWER7
> */
> diff --git a/arch/powerpc/perf/ppc970-pmu.c b/arch/powerpc/perf/ppc970-pmu.c
> index d35223fb112c..7d78df97f272 100644
> --- a/arch/powerpc/perf/ppc970-pmu.c
> +++ b/arch/powerpc/perf/ppc970-pmu.c
> @@ -9,6 +9,8 @@
> #include <asm/reg.h>
> #include <asm/cputable.h>
>
> +#include "internal.h"
> +
> /*
> * Bits in event code for PPC970
> */
More information about the Linuxppc-dev
mailing list