[lkml]   [2014]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [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

> > > + 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.
[unhandled content-type:application/pgp-signature]
 \ /
  Last update: 2014-03-01 05:41    [W:0.054 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site