From: Guennadi Liakhovetski Date: Thu, 17 Jan 2013 09:45:54 +0000 (+0100) Subject: i2c: sh_mobile: cosmetic: trivially simplify 2 functions X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=05cf936846ca6aef1b34ba26054728fdbc154558;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git i2c: sh_mobile: cosmetic: trivially simplify 2 functions Reduce 2 boolean functions from "if (condition) return 1; return 0;" to "return condition;" Signed-off-by: Guennadi Liakhovetski Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index b6e7a83a8296..34024f3a19f5 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c @@ -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,