i2c: rcar: remove sign-compare flaw
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sat, 20 Sep 2014 10:07:37 +0000 (12:07 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 29 Sep 2014 20:43:25 +0000 (22:43 +0200)
gcc rightfully says:

drivers/i2c/busses/i2c-rcar.c:198:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-rcar.c

index b694cba6380742dd19984a7fdf1c67875b78f7aa..d826e82dd997efda5af2adce8f436c1e04493e54 100644 (file)
@@ -195,7 +195,7 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv,
         */
        rate = clk_get_rate(priv->clk);
        cdf = rate / 20000000;
-       if (cdf >= 1 << cdf_width) {
+       if (cdf >= 1U << cdf_width) {
                dev_err(dev, "Input clock %lu too high\n", rate);
                return -EIO;
        }