Thread (13 messages) 13 messages, 4 authors, 2021-05-11

Re: [PATCH v2 3/3] i2c: mpc: implement erratum A-004447 workaround

From: Andy Shevchenko <hidden>
Date: 2021-05-07 15:37:18
Also in: linux-i2c, linuxppc-dev, lkml

On Fri, May 7, 2021 at 5:52 PM Joakim Tjernlund
[off-list ref] wrote:
On Fri, 2021-05-07 at 14:46 +0300, Andy Shevchenko wrote:
quoted
On Fri, May 7, 2021 at 3:40 AM Chris Packham
[off-list ref] wrote:
...
quoted
So, now you may shrink it even further, i.e.

       void __iomem *sr = i2c->base + MPC_I2C_SR;
       u8 val;

       return readb_poll_timeout(sr, val, val & mask, 0, 100);
val looks uninitialised before use?
Nope.

Thinking about naming, perhaps

        void __iomem *addr = i2c->base + MPC_I2C_SR;
        u8 sr; // or leave as val?

        return readb_poll_timeout(addr, sr, sr & mask, 0, 100);

would be more clear.

-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help