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.