[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140301040327.GL29849@sirena.org.uk>
Date: Sat, 1 Mar 2014 13:03:27 +0900
From: Mark Brown <broonie@...nel.org>
To: "Opensource [Anthony Olech]" <anthony.olech.opensource@...semi.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
David Dajun Chen <david.chen@...semi.com>
Subject: Re: [RFC V1] drivers/base/regmap: Implementation for
regmap_multi_reg_write
On Fri, Feb 28, 2014 at 03:58:34PM +0000, Opensource [Anthony Olech] wrote:
> The algorithm for splitting up into smaller _multi_reg_writes is easy enough,
> so if the calling device driver created a set of (reg,val) pairs for a multi reg
> write operation then surely the intention is for the individual pieces to be
> handled as multi reg writes.
Right, that's what should eventually happen - what I'm saying is it's OK
to defer the hard parts for later if they're not needed right now (in
much the same way that the API was added without an actual multi write
implementation).
> > > + for (i = 0, n = 0, switched = false, base = regs; i < num_regs;
> > > + i++, n++) {
> > Don't put all this stuff in the for (), just put the iteration in the for ().
> all those variables are a fundamental part of the loop, but I will change it.
It's still ugly and hard to read, look at the line wrapping... the
normal thing is to have preconditions that aren't part of the actual
iteration process immediately before the loop statement.
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists