Skip to content

Commit

Permalink
i2c: sh_mobile: cosmetic: trivially simplify 2 functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guennadi Liakhovetski authored and Wolfram Sang committed Feb 10, 2013
1 parent 626f0a2 commit 05cf936
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions drivers/i2c/busses/i2c-sh_mobile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 05cf936

Please sign in to comment.