Skip to content

Commit f311507

Browse files
zoanana990Wolfram Sang
authored andcommitted
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: Hsin-Yu.Chen <harry021633@gmail.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> [wsa: slightly updated commit message] Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
1 parent 8821c83 commit f311507

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/i2c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
931931

932932
static inline u8 i2c_8bit_addr_from_msg(const struct i2c_msg *msg)
933933
{
934-
return (msg->addr << 1) | (msg->flags & I2C_M_RD ? 1 : 0);
934+
return (msg->addr << 1) | (msg->flags & I2C_M_RD);
935935
}
936936

937937
u8 *i2c_get_dma_safe_msg_buf(struct i2c_msg *msg, unsigned int threshold);

0 commit comments

Comments
 (0)