lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180810122511.2xnelcn6tguirfbp@pengutronix.de>
Date:   Fri, 10 Aug 2018 14:25:11 +0200
From:   Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>
To:     Esben Haabendal <esben.haabendal@...il.com>
Cc:     linux-i2c@...r.kernel.org,
        Wolfram Sang <wsa+renesas@...g-engineering.com>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Yuan Yao <yao.yuan@...escale.com>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Phil Reid <preid@...ctromag.com.au>,
        Lucas Stach <l.stach@...gutronix.de>,
        Clemens Gruber <clemens.gruber@...ruber.com>,
        Peter Rosin <peda@...ntia.se>,
        Fabio Estevam <fabio.estevam@....com>,
        linux-kernel@...r.kernel.org
Subject: Re: [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@...gutronix.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/  |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ