public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2] clk: bcm: kona: don't return -EFOO as bool
@ 2014-12-08 21:54 Olof Johansson
  2014-12-08 21:54 ` [PATCH 2/2] clk: bcm: kona: make a variable static Olof Johansson
  2014-12-09  8:59 ` [PATCH 1/2] clk: bcm: kona: don't return -EFOO as bool Arnd Bergmann
  0 siblings, 2 replies; 3+ messages in thread
From: Olof Johansson @ 2014-12-08 21:54 UTC (permalink / raw)
  To: linux-arm-kernel

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(-)

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 */
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] clk: bcm: kona: make a variable static
  2014-12-08 21:54 [PATCH 1/2] clk: bcm: kona: don't return -EFOO as bool Olof Johansson
@ 2014-12-08 21:54 ` Olof Johansson
  2014-12-09  8:59 ` [PATCH 1/2] clk: bcm: kona: don't return -EFOO as bool Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: Olof Johansson @ 2014-12-08 21:54 UTC (permalink / raw)
  To: linux-arm-kernel

Not used outside of this file.

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

diff --git a/drivers/clk/bcm/clk-kona-setup.c b/drivers/clk/bcm/clk-kona-setup.c
index e5aeded..152e7fe 100644
--- a/drivers/clk/bcm/clk-kona-setup.c
+++ b/drivers/clk/bcm/clk-kona-setup.c
@@ -21,7 +21,7 @@
 #define selector_clear_exists(sel)	((sel)->width = 0)
 #define trigger_clear_exists(trig)	FLAG_CLEAR(trig, TRIG, EXISTS)
 
-LIST_HEAD(ccu_list);	/* The list of set up CCUs */
+static LIST_HEAD(ccu_list);	/* The list of set up CCUs */
 
 /* Validity checking */
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 1/2] clk: bcm: kona: don't return -EFOO as bool
  2014-12-08 21:54 [PATCH 1/2] clk: bcm: kona: don't return -EFOO as bool Olof Johansson
  2014-12-08 21:54 ` [PATCH 2/2] clk: bcm: kona: make a variable static Olof Johansson
@ 2014-12-09  8:59 ` Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2014-12-09  8:59 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-09  8:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-08 21:54 [PATCH 1/2] clk: bcm: kona: don't return -EFOO as bool Olof Johansson
2014-12-08 21:54 ` [PATCH 2/2] clk: bcm: kona: make a variable static Olof Johansson
2014-12-09  8:59 ` [PATCH 1/2] clk: bcm: kona: don't return -EFOO as bool Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox