diff mbox series

[1/2] clk: ls1028a: Fix warning on clamp() usage

Message ID 20200203052507.93215-1-sboyd@kernel.org (mailing list archive)
State Accepted, archived
Headers show
Series [1/2] clk: ls1028a: Fix warning on clamp() usage | expand

Commit Message

Stephen Boyd Feb. 3, 2020, 5:25 a.m. UTC
These constants are used in clamp() with the value being clamped an
unsigned long. Make them unsigned long defines so that clamp() doesn't
complain about comparing different types.

In file included from include/linux/list.h:9,
                 from include/linux/kobject.h:19,
                 from include/linux/of.h:17,
                 from include/linux/clk-provider.h:9,
                 from drivers/clk/clk-plldig.c:8:
drivers/clk/clk-plldig.c: In function 'plldig_determine_rate':
include/linux/kernel.h:835:29: warning: comparison of distinct pointer types lacks a cast
  835 |   (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
      |

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Wen He <wen.he_1@nxp.com>
Fixes: d37010a3c162 ("clk: ls1028a: Add clock driver for Display output interface")
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
---
 drivers/clk/clk-plldig.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Stephen Boyd Feb. 3, 2020, 6:33 p.m. UTC | #1
Quoting Stephen Boyd (2020-02-02 21:25:06)
> These constants are used in clamp() with the value being clamped an
> unsigned long. Make them unsigned long defines so that clamp() doesn't
> complain about comparing different types.
> 
> In file included from include/linux/list.h:9,
>                  from include/linux/kobject.h:19,
>                  from include/linux/of.h:17,
>                  from include/linux/clk-provider.h:9,
>                  from drivers/clk/clk-plldig.c:8:
> drivers/clk/clk-plldig.c: In function 'plldig_determine_rate':
> include/linux/kernel.h:835:29: warning: comparison of distinct pointer types lacks a cast
>   835 |   (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
>       |
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Cc: Wen He <wen.he_1@nxp.com>
> Fixes: d37010a3c162 ("clk: ls1028a: Add clock driver for Display output interface")
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---

Applied to clk-next
diff mbox series

Patch

diff --git a/drivers/clk/clk-plldig.c b/drivers/clk/clk-plldig.c
index a5da08f98d01..312b8312d503 100644
--- a/drivers/clk/clk-plldig.c
+++ b/drivers/clk/clk-plldig.c
@@ -37,8 +37,8 @@ 
 #define PLLDIG_MAX_VCO_FREQ         1300000000
 
 /* Range of the output frequencies, in Hz */
-#define PHI1_MIN_FREQ               27000000
-#define PHI1_MAX_FREQ               600000000
+#define PHI1_MIN_FREQ               27000000UL
+#define PHI1_MAX_FREQ               600000000UL
 
 /* Maximum value of the reduced frequency divider */
 #define MAX_RFDPHI1          63UL