lkml.org 
[lkml]   [2018]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/4] i2c: imx: Simplify stopped state tracking
Hello Esben,

On Fri, Aug 10, 2018 at 11:25:34AM +0200, Esben Haabendal wrote:
> Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
> > Currently you have:
> >
> > if (for_busy && (temp & I2SR_IBB)) {
> > i2c_imx->stopped = 0;
> > break;
> > }
> >
> > if (!for_busy && !(temp & I2SR_IBB)) {
> > i2c_imx->stopped = 1;
> > break;
> > }
> >
> > The semantic of this is the same (apart from always updating .stopped)
> > but is imho easier:
> >
> > i2c_imx->stopped = !(temp & I2SR_IBB);
> >
> > if (for_busy != i2c_imx->stopped)
> > break;
>
> Yes, that should work also.
> Shorter, but IMHO a bit more convoluted to read.
> Let me know if I should send a new version with this change.

unless someone else chimes in I'd say keep it as is. I'd prefer my
variant, but I accept that this is something subjective.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |

\
 
 \ /
  Last update: 2018-08-10 14:26    [W:0.259 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site