[PATCH 00/21] i2c: make use of i2c_8bit_addr_from_msg

Joe Perches joe at perches.com
Tue May 15 02:11:57 AEST 2018


On Mon, 2018-05-14 at 16:53 +0200, Peter Rosin wrote:
> Hi!
> 
> The nice little inline i2c_8bit_addr_from_msg is not getting
> enough use. This series improves the situation and drops a
> bunch of lines in the process.

Perhaps the inline should test for I2C_M_REV_DIR_ADDR
as there is at least one use like

-               addr = msg->addr << 1;
-               if (flags & I2C_M_RD)
-                       addr |= 1;
+               addr = i2c_8bit_addr_from_msg(msg);
                if (flags & I2C_M_REV_DIR_ADDR)
                        addr ^= 1;

which look odd

Do any of these changes now no longer need
the temporary flags variable?


More information about the openbmc mailing list