i2c: sh_mobile: cosmetic: trivially simplify 2 functions
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Thu, 17 Jan 2013 09:45:54 +0000 (10:45 +0100)
committerWolfram Sang <wolfram@the-dreams.de>
Sun, 10 Feb 2013 18:55:22 +0000 (19:55 +0100)
Reduce 2 boolean functions from "if (condition) return 1; return 0;" to
"return condition;"

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Wolfram Sang <wolfram@the-dreams.de>
drivers/i2c/busses/i2c-sh_mobile.c

index b6e7a83a8296e719870efb35f8c456c7caf5f94f..34024f3a19f5133f281441ecf32f1a661d7752b6 100644 (file)
@@ -349,20 +349,14 @@ static unsigned char i2c_op(struct sh_mobile_i2c_data *pd,
        return ret;
 }
 
-static int sh_mobile_i2c_is_first_byte(struct sh_mobile_i2c_data *pd)
+static bool sh_mobile_i2c_is_first_byte(struct sh_mobile_i2c_data *pd)
 {
-       if (pd->pos == -1)
-               return 1;
-
-       return 0;
+       return pd->pos == -1;
 }
 
-static int sh_mobile_i2c_is_last_byte(struct sh_mobile_i2c_data *pd)
+static bool sh_mobile_i2c_is_last_byte(struct sh_mobile_i2c_data *pd)
 {
-       if (pd->pos == (pd->msg->len - 1))
-               return 1;
-
-       return 0;
+       return pd->pos == pd->msg->len - 1;
 }
 
 static void sh_mobile_i2c_get_data(struct sh_mobile_i2c_data *pd,