Commit f311507c authored by Hsin-Yu.Chen's avatar Hsin-Yu.Chen Committed by Wolfram Sang

i2c: remove redundant condition

I2C_M_RD is defined as and guaranteed to be 1 and 'flag & I2C_M_RD' is
one or zero. No need for an additional condition to obtain the value.
Signed-off-by: default avatarHsin-Yu.Chen <harry021633@gmail.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@kernel.org>
[wsa: slightly updated commit message]
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
parent 8821c837
......@@ -931,7 +931,7 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
static inline u8 i2c_8bit_addr_from_msg(const struct i2c_msg *msg)
{
return (msg->addr << 1) | (msg->flags & I2C_M_RD ? 1 : 0);
return (msg->addr << 1) | (msg->flags & I2C_M_RD);
}
u8 *i2c_get_dma_safe_msg_buf(struct i2c_msg *msg, unsigned int threshold);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment