diff mbox

[1/2] clk: bcm: kona: don't return -EFOO as bool

Message ID 1418075645-14571-1-git-send-email-olof@lixom.net (mailing list archive)
State New, archived
Headers show

Commit Message

Olof Johansson Dec. 8, 2014, 9:54 p.m. UTC
Found with sparse:

drivers/clk/bcm/clk-kona.c:1255:16: warning: odd constant _Bool cast (ffffffffffffffea becomes 1)

Signed-off-by: Olof Johansson <olof@lixom.net>
---
 drivers/clk/bcm/clk-kona.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arnd Bergmann Dec. 9, 2014, 8:59 a.m. UTC | #1
On Monday 08 December 2014 13:54:04 Olof Johansson wrote:
> diff --git a/drivers/clk/bcm/clk-kona.c b/drivers/clk/bcm/clk-kona.c
> index 95af2e6..53fca77 100644
> --- a/drivers/clk/bcm/clk-kona.c
> +++ b/drivers/clk/bcm/clk-kona.c
> @@ -1252,7 +1252,7 @@ static bool __kona_clk_init(struct kona_clk *bcm_clk)
>         default:
>                 BUG();
>         }
> -       return -EINVAL;
> +       return false;
>  }

Nothing wrong with your patch, but the __kona_clk_init() function is
still very strange. Note that the return statement is unreachable,
and the reason for the BUG() statement to not be hit is that all
kona clocks have type=bcm_clk_peri.

	Arnd
diff mbox

Patch

diff --git a/drivers/clk/bcm/clk-kona.c b/drivers/clk/bcm/clk-kona.c
index 95af2e6..53fca77 100644
--- a/drivers/clk/bcm/clk-kona.c
+++ b/drivers/clk/bcm/clk-kona.c
@@ -1252,7 +1252,7 @@  static bool __kona_clk_init(struct kona_clk *bcm_clk)
 	default:
 		BUG();
 	}
-	return -EINVAL;
+	return false;
 }
 
 /* Set a CCU and all its clocks into their desired initial state */