2023-05-08 16:08:44

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH 1/2] ARM: perf: Mark all accessor functions inline

When just including <asm/arm_pmuv3.h>:

arch/arm/include/asm/arm_pmuv3.h:110:13: error: ‘write_pmevtypern’ defined but not used [-Werror=unused-function]
110 | static void write_pmevtypern(int n, unsigned long val)
| ^~~~~~~~~~~~~~~~
arch/arm/include/asm/arm_pmuv3.h:103:13: error: ‘write_pmevcntrn’ defined but not used [-Werror=unused-function]
103 | static void write_pmevcntrn(int n, unsigned long val)
| ^~~~~~~~~~~~~~~
arch/arm/include/asm/arm_pmuv3.h:95:22: error: ‘read_pmevcntrn’ defined but not used [-Werror=unused-function]
95 | static unsigned long read_pmevcntrn(int n)
| ^~~~~~~~~~~~~~

Fix this by adding the missing "inline" keywords to the three accessor
functions that lack them.

Fixes: 009d6dc87a568db6 ("ARM: perf: Allow the use of the PMUv3 driver on 32bit ARM")
Signed-off-by: Geert Uytterhoeven <[email protected]>
---
arch/arm/include/asm/arm_pmuv3.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/arm_pmuv3.h b/arch/arm/include/asm/arm_pmuv3.h
index 78d3d4b82c6c2598..f4db3e75d75f024e 100644
--- a/arch/arm/include/asm/arm_pmuv3.h
+++ b/arch/arm/include/asm/arm_pmuv3.h
@@ -92,7 +92,7 @@

#define RETURN_READ_PMEVCNTRN(n) \
return read_sysreg(PMEVCNTR##n)
-static unsigned long read_pmevcntrn(int n)
+static inline unsigned long read_pmevcntrn(int n)
{
PMEVN_SWITCH(n, RETURN_READ_PMEVCNTRN);
return 0;
@@ -100,14 +100,14 @@ static unsigned long read_pmevcntrn(int n)

#define WRITE_PMEVCNTRN(n) \
write_sysreg(val, PMEVCNTR##n)
-static void write_pmevcntrn(int n, unsigned long val)
+static inline void write_pmevcntrn(int n, unsigned long val)
{
PMEVN_SWITCH(n, WRITE_PMEVCNTRN);
}

#define WRITE_PMEVTYPERN(n) \
write_sysreg(val, PMEVTYPER##n)
-static void write_pmevtypern(int n, unsigned long val)
+static inline void write_pmevtypern(int n, unsigned long val)
{
PMEVN_SWITCH(n, WRITE_PMEVTYPERN);
}
--
2.34.1


2023-05-09 08:08:47

by Marc Zyngier

[permalink] [raw]
Subject: Re: [PATCH 1/2] ARM: perf: Mark all accessor functions inline

On Mon, 08 May 2023 17:05:18 +0100,
Geert Uytterhoeven <[email protected]> wrote:
>
> When just including <asm/arm_pmuv3.h>:
>
> arch/arm/include/asm/arm_pmuv3.h:110:13: error: ‘write_pmevtypern’ defined but not used [-Werror=unused-function]
> 110 | static void write_pmevtypern(int n, unsigned long val)
> | ^~~~~~~~~~~~~~~~
> arch/arm/include/asm/arm_pmuv3.h:103:13: error: ‘write_pmevcntrn’ defined but not used [-Werror=unused-function]
> 103 | static void write_pmevcntrn(int n, unsigned long val)
> | ^~~~~~~~~~~~~~~
> arch/arm/include/asm/arm_pmuv3.h:95:22: error: ‘read_pmevcntrn’ defined but not used [-Werror=unused-function]
> 95 | static unsigned long read_pmevcntrn(int n)
> | ^~~~~~~~~~~~~~
>
> Fix this by adding the missing "inline" keywords to the three accessor
> functions that lack them.
>
> Fixes: 009d6dc87a568db6 ("ARM: perf: Allow the use of the PMUv3 driver on 32bit ARM")
> Signed-off-by: Geert Uytterhoeven <[email protected]>

Reviewed-by: Marc Zyngier <[email protected]>

M.

--
Without deviation from the norm, progress is not possible.

2023-05-09 11:53:25

by Mark Rutland

[permalink] [raw]
Subject: Re: [PATCH 1/2] ARM: perf: Mark all accessor functions inline

On Mon, May 08, 2023 at 06:05:18PM +0200, Geert Uytterhoeven wrote:
> When just including <asm/arm_pmuv3.h>:
>
> arch/arm/include/asm/arm_pmuv3.h:110:13: error: ‘write_pmevtypern’ defined but not used [-Werror=unused-function]
> 110 | static void write_pmevtypern(int n, unsigned long val)
> | ^~~~~~~~~~~~~~~~
> arch/arm/include/asm/arm_pmuv3.h:103:13: error: ‘write_pmevcntrn’ defined but not used [-Werror=unused-function]
> 103 | static void write_pmevcntrn(int n, unsigned long val)
> | ^~~~~~~~~~~~~~~
> arch/arm/include/asm/arm_pmuv3.h:95:22: error: ‘read_pmevcntrn’ defined but not used [-Werror=unused-function]
> 95 | static unsigned long read_pmevcntrn(int n)
> | ^~~~~~~~~~~~~~
>
> Fix this by adding the missing "inline" keywords to the three accessor
> functions that lack them.
>
> Fixes: 009d6dc87a568db6 ("ARM: perf: Allow the use of the PMUv3 driver on 32bit ARM")
> Signed-off-by: Geert Uytterhoeven <[email protected]>

Acked-by: Mark Rutland <[email protected]>

Mark.

> ---
> arch/arm/include/asm/arm_pmuv3.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/include/asm/arm_pmuv3.h b/arch/arm/include/asm/arm_pmuv3.h
> index 78d3d4b82c6c2598..f4db3e75d75f024e 100644
> --- a/arch/arm/include/asm/arm_pmuv3.h
> +++ b/arch/arm/include/asm/arm_pmuv3.h
> @@ -92,7 +92,7 @@
>
> #define RETURN_READ_PMEVCNTRN(n) \
> return read_sysreg(PMEVCNTR##n)
> -static unsigned long read_pmevcntrn(int n)
> +static inline unsigned long read_pmevcntrn(int n)
> {
> PMEVN_SWITCH(n, RETURN_READ_PMEVCNTRN);
> return 0;
> @@ -100,14 +100,14 @@ static unsigned long read_pmevcntrn(int n)
>
> #define WRITE_PMEVCNTRN(n) \
> write_sysreg(val, PMEVCNTR##n)
> -static void write_pmevcntrn(int n, unsigned long val)
> +static inline void write_pmevcntrn(int n, unsigned long val)
> {
> PMEVN_SWITCH(n, WRITE_PMEVCNTRN);
> }
>
> #define WRITE_PMEVTYPERN(n) \
> write_sysreg(val, PMEVTYPER##n)
> -static void write_pmevtypern(int n, unsigned long val)
> +static inline void write_pmevtypern(int n, unsigned long val)
> {
> PMEVN_SWITCH(n, WRITE_PMEVTYPERN);
> }
> --
> 2.34.1
>