diff mbox series

[4/4] clk: stm32mp1: solve type issue in stm32mp1_lse_enable and stm32mp1_clktree

Message ID 20200128094415.5768-5-patrick.delaunay@st.com
State Accepted
Commit eb49dce0d8a63f1cfb281bc2b45566ab7cba3c00
Delegated to: Patrick Delaunay
Headers show
Series Several patch to solve warning on stm32mp1 board with W=1 | expand

Commit Message

Patrick DELAUNAY Jan. 28, 2020, 9:44 a.m. UTC
Solve type issue in stm32mp1_lse_enable and stm32mp1_clktree.

This patch solves the warnings when compiling with W=1
on stm32mp1 board:

clk_stm32mp1.c: In function ‘stm32mp1_lse_enable’:
clk_stm32mp1.c:1238:15: warning: comparison of integer expressions
  of different signedness: ‘u32’ {aka ‘unsigned int’} and ‘int’
  [-Wsign-compare]
clk_stm32mp1.c:1239:13: warning: comparison of integer expressions
  of different signedness: ‘u32’ {aka ‘unsigned int’} and ‘int’
  [-Wsign-compare]

clk_stm32mp1.c: In function ‘stm32mp1_clktree’:
clk_stm32mp1.c:1814:17: warning: comparison of integer expressions
  of different signedness: ‘int’ and ‘unsigned int’
  [-Wsign-compare]

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---

 drivers/clk/clk_stm32mp1.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Patrice CHOTARD Feb. 14, 2020, 8:07 a.m. UTC | #1
On 1/28/20 10:44 AM, Patrick Delaunay wrote:
> Solve type issue in stm32mp1_lse_enable and stm32mp1_clktree.
>
> This patch solves the warnings when compiling with W=1
> on stm32mp1 board:
>
> clk_stm32mp1.c: In function ‘stm32mp1_lse_enable’:
> clk_stm32mp1.c:1238:15: warning: comparison of integer expressions
>   of different signedness: ‘u32’ {aka ‘unsigned int’} and ‘int’
>   [-Wsign-compare]
> clk_stm32mp1.c:1239:13: warning: comparison of integer expressions
>   of different signedness: ‘u32’ {aka ‘unsigned int’} and ‘int’
>   [-Wsign-compare]
>
> clk_stm32mp1.c: In function ‘stm32mp1_clktree’:
> clk_stm32mp1.c:1814:17: warning: comparison of integer expressions
>   of different signedness: ‘int’ and ‘unsigned int’
>   [-Wsign-compare]
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
>  drivers/clk/clk_stm32mp1.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/clk/clk_stm32mp1.c b/drivers/clk/clk_stm32mp1.c
> index da66bde41b..fd8c821e48 100644
> --- a/drivers/clk/clk_stm32mp1.c
> +++ b/drivers/clk/clk_stm32mp1.c
> @@ -1218,7 +1218,7 @@ static int stm32mp1_osc_wait(int enable, fdt_addr_t rcc, u32 offset,
>  }
>  
>  static void stm32mp1_lse_enable(fdt_addr_t rcc, int bypass, int digbyp,
> -				int lsedrv)
> +				u32 lsedrv)
>  {
>  	u32 value;
>  
> @@ -1651,8 +1651,8 @@ static int stm32mp1_clktree(struct udevice *dev)
>  	unsigned int clkdiv[CLKDIV_NB];
>  	unsigned int pllcfg[_PLL_NB][PLLCFG_NB];
>  	ofnode plloff[_PLL_NB];
> -	int ret;
> -	int i, len;
> +	int ret, len;
> +	uint i;
>  	int lse_css = 0;
>  	const u32 *pkcs_cell;
>  
> @@ -1698,7 +1698,8 @@ static int stm32mp1_clktree(struct udevice *dev)
>  		stm32mp1_lsi_set(rcc, 1);
>  
>  	if (priv->osc[_LSE]) {
> -		int bypass, digbyp, lsedrv;
> +		int bypass, digbyp;
> +		u32 lsedrv;
>  		struct udevice *dev = priv->osc_dev[_LSE];
>  
>  		bypass = dev_read_bool(dev, "st,bypass");


Reviewed-by: Patrice Chotard <patrice.chotard@st.com>

Thanks
Patrick DELAUNAY Feb. 14, 2020, 10:31 a.m. UTC | #2
Hi,

> From: Patrick DELAUNAY <patrick.delaunay@st.com>
> Sent: mardi 28 janvier 2020 10:44
> 
> Solve type issue in stm32mp1_lse_enable and stm32mp1_clktree.
> 
> This patch solves the warnings when compiling with W=1 on stm32mp1 board:
> 
> clk_stm32mp1.c: In function ‘stm32mp1_lse_enable’:
> clk_stm32mp1.c:1238:15: warning: comparison of integer expressions
>   of different signedness: ‘u32’ {aka ‘unsigned int’} and ‘int’
>   [-Wsign-compare]
> clk_stm32mp1.c:1239:13: warning: comparison of integer expressions
>   of different signedness: ‘u32’ {aka ‘unsigned int’} and ‘int’
>   [-Wsign-compare]
> 
> clk_stm32mp1.c: In function ‘stm32mp1_clktree’:
> clk_stm32mp1.c:1814:17: warning: comparison of integer expressions
>   of different signedness: ‘int’ and ‘unsigned int’
>   [-Wsign-compare]
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---

Applied to u-boot-stm32/master, thanks!

Regards
Patrick
diff mbox series

Patch

diff --git a/drivers/clk/clk_stm32mp1.c b/drivers/clk/clk_stm32mp1.c
index da66bde41b..fd8c821e48 100644
--- a/drivers/clk/clk_stm32mp1.c
+++ b/drivers/clk/clk_stm32mp1.c
@@ -1218,7 +1218,7 @@  static int stm32mp1_osc_wait(int enable, fdt_addr_t rcc, u32 offset,
 }
 
 static void stm32mp1_lse_enable(fdt_addr_t rcc, int bypass, int digbyp,
-				int lsedrv)
+				u32 lsedrv)
 {
 	u32 value;
 
@@ -1651,8 +1651,8 @@  static int stm32mp1_clktree(struct udevice *dev)
 	unsigned int clkdiv[CLKDIV_NB];
 	unsigned int pllcfg[_PLL_NB][PLLCFG_NB];
 	ofnode plloff[_PLL_NB];
-	int ret;
-	int i, len;
+	int ret, len;
+	uint i;
 	int lse_css = 0;
 	const u32 *pkcs_cell;
 
@@ -1698,7 +1698,8 @@  static int stm32mp1_clktree(struct udevice *dev)
 		stm32mp1_lsi_set(rcc, 1);
 
 	if (priv->osc[_LSE]) {
-		int bypass, digbyp, lsedrv;
+		int bypass, digbyp;
+		u32 lsedrv;
 		struct udevice *dev = priv->osc_dev[_LSE];
 
 		bypass = dev_read_bool(dev, "st,bypass");