diff mbox series

[U-Boot,v2,1/3] arm64: zynqmp: xil_io.h: declare functions as static

Message ID 20190524134003.32317-1-luca@lucaceresoli.net
State Accepted
Commit 04d2b0c7c2e518c1d44a1347e709af004708dce4
Delegated to: Michal Simek
Headers show
Series [U-Boot,v2,1/3] arm64: zynqmp: xil_io.h: declare functions as static | expand

Commit Message

Luca Ceresoli May 24, 2019, 1:40 p.m. UTC
Fixes sparse warnings when building zynqmp defconfigs:
  ./board/xilinx/zynqmp/xil_io.h:12:6: warning: symbol 'Xil_Out32' was not declared. Should it be static?
  ./board/xilinx/zynqmp/xil_io.h:17:5: warning: symbol 'Xil_In32' was not declared. Should it be static?
  ./board/xilinx/zynqmp/xil_io.h:22:6: warning: symbol 'usleep' was not declared. Should it be static?

Also add __maybe_unused to usleep() since it is not used by minimized
psu_init_gpl.c files, so it would warn as "defined but not used".

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

---

Chages v1 -> v2:
 - fix commit text (Michal)
---
 board/xilinx/zynqmp/xil_io.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Michal Simek May 28, 2019, 6:29 a.m. UTC | #1
On 24. 05. 19 15:40, Luca Ceresoli wrote:
> Fixes sparse warnings when building zynqmp defconfigs:
>   ./board/xilinx/zynqmp/xil_io.h:12:6: warning: symbol 'Xil_Out32' was not declared. Should it be static?
>   ./board/xilinx/zynqmp/xil_io.h:17:5: warning: symbol 'Xil_In32' was not declared. Should it be static?
>   ./board/xilinx/zynqmp/xil_io.h:22:6: warning: symbol 'usleep' was not declared. Should it be static?
> 
> Also add __maybe_unused to usleep() since it is not used by minimized
> psu_init_gpl.c files, so it would warn as "defined but not used".
> 
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> 
> ---
> 
> Chages v1 -> v2:
>  - fix commit text (Michal)
> ---
>  board/xilinx/zynqmp/xil_io.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/board/xilinx/zynqmp/xil_io.h b/board/xilinx/zynqmp/xil_io.h
> index c476c902ebcb..1c1bf32adaae 100644
> --- a/board/xilinx/zynqmp/xil_io.h
> +++ b/board/xilinx/zynqmp/xil_io.h
> @@ -9,17 +9,17 @@
>  
>  #define xil_printf(...)
>  
> -void Xil_Out32(unsigned long addr, unsigned long val)
> +static void Xil_Out32(unsigned long addr, unsigned long val)
>  {
>  	writel(val, addr);
>  }
>  
> -int Xil_In32(unsigned long addr)
> +static int Xil_In32(unsigned long addr)
>  {
>  	return readl(addr);
>  }
>  
> -void usleep(u32 sleep)
> +static void __maybe_unused usleep(u32 sleep)
>  {
>  	udelay(sleep);
>  }
> 

applied.
M
diff mbox series

Patch

diff --git a/board/xilinx/zynqmp/xil_io.h b/board/xilinx/zynqmp/xil_io.h
index c476c902ebcb..1c1bf32adaae 100644
--- a/board/xilinx/zynqmp/xil_io.h
+++ b/board/xilinx/zynqmp/xil_io.h
@@ -9,17 +9,17 @@ 
 
 #define xil_printf(...)
 
-void Xil_Out32(unsigned long addr, unsigned long val)
+static void Xil_Out32(unsigned long addr, unsigned long val)
 {
 	writel(val, addr);
 }
 
-int Xil_In32(unsigned long addr)
+static int Xil_In32(unsigned long addr)
 {
 	return readl(addr);
 }
 
-void usleep(u32 sleep)
+static void __maybe_unused usleep(u32 sleep)
 {
 	udelay(sleep);
 }