Skip to content

Commit 05cf936

Browse files
lyakhwsakernel
authored andcommitted
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 <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 626f0a2 commit 05cf936

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

drivers/i2c/busses/i2c-sh_mobile.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -349,20 +349,14 @@ static unsigned char i2c_op(struct sh_mobile_i2c_data *pd,
349349
return ret;
350350
}
351351

352-
static int sh_mobile_i2c_is_first_byte(struct sh_mobile_i2c_data *pd)
352+
static bool sh_mobile_i2c_is_first_byte(struct sh_mobile_i2c_data *pd)
353353
{
354-
if (pd->pos == -1)
355-
return 1;
356-
357-
return 0;
354+
return pd->pos == -1;
358355
}
359356

360-
static int sh_mobile_i2c_is_last_byte(struct sh_mobile_i2c_data *pd)
357+
static bool sh_mobile_i2c_is_last_byte(struct sh_mobile_i2c_data *pd)
361358
{
362-
if (pd->pos == (pd->msg->len - 1))
363-
return 1;
364-
365-
return 0;
359+
return pd->pos == pd->msg->len - 1;
366360
}
367361

368362
static void sh_mobile_i2c_get_data(struct sh_mobile_i2c_data *pd,

0 commit comments

Comments
 (0)