Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05cf9368 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Wolfram Sang
Browse files

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: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarWolfram Sang <wolfram@the-dreams.de>
parent 626f0a2f
Loading
Loading
Loading
Loading
+4 −10
Original line number Original line Diff line number Diff line
@@ -349,20 +349,14 @@ static unsigned char i2c_op(struct sh_mobile_i2c_data *pd,
	return ret;
	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 pd->pos == -1;
		return 1;

	return 0;
}
}


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 pd->pos == pd->msg->len - 1;
		return 1;

	return 0;
}
}


static void sh_mobile_i2c_get_data(struct sh_mobile_i2c_data *pd,
static void sh_mobile_i2c_get_data(struct sh_mobile_i2c_data *pd,