[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <29558f7d-1b80-8c6b-cd26-58cab6bc3ee1@axentia.se>
Date: Mon, 14 May 2018 19:01:23 +0200
From: Peter Rosin <peda@...ntia.se>
To: Joe Perches <joe@...ches.com>, linux-kernel@...r.kernel.org
Cc: Brendan Higgins <brendanhiggins@...gle.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Joel Stanley <joel@....id.au>,
Andrew Jeffery <andrew@...id.au>,
Guenter Roeck <linux@...ck-us.net>,
Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Peter Korsgaard <jacmet@...site.dk>,
Andy Gross <andy.gross@...aro.org>,
David Brown <david.brown@...aro.org>,
Linus Walleij <linus.walleij@...aro.org>,
linux-i2c@...r.kernel.org, openbmc@...ts.ozlabs.org,
linux-arm-kernel@...ts.infradead.org,
linux-aspeed@...ts.ozlabs.org, linuxppc-dev@...ts.ozlabs.org,
linux-arm-msm@...r.kernel.org, linux-soc@...r.kernel.org
Subject: Re: [PATCH 00/21] i2c: make use of i2c_8bit_addr_from_msg
On 2018-05-14 18:11, Joe Perches wrote:
> 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
I say no, because the driver has to also indicate support with
I2C_FUNC_PROTOCOL_MANGLING and I don't see a sane way to check
that part of the contract. But what do I know. Seems orthogonal.
> Do any of these changes now no longer need
> the temporary flags variable?
Right, I thought I had made any obvious further simplification made
possible by these changes, but I overlooked that one. The flags
variable is certainly over-engineered in i2c-algo-pcf.c and would
be a good candidate for removal. But that's only patch 3/21.
I'll wait for a bit with an update, and Wolfram can adjust this on
the way in if he feels like it.
Cheers,
Peter
Powered by blists - more mailing lists