lkml.org 
[lkml]   [2009]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] percpu: explain quick paths in pcpu_[de]populate_chunk()
Hello,

On 12/01/2009 02:40 PM, Cong Wang wrote:
>> So, I don't know. The first iteration only loop looks a bit unusual
>> for sure but it isn't something conceptually convoluted.
>
> Now this seems to be better. So with this change, we can do:
>
> pcpu_first_pop_region(chunk, rs, re, start, end);
> if (rs < re && ...)
> return;
>
> Right?

Yeap, but is that any better? Passing lvalue loop parameters to loop
constructs is customary. For almost all other cases, it's not, so

pcpu_first_pop_region(chunk, &rs, &re, start, end)

would be better but then we have two similar looking interfaces which
take different types of parameters. Also, you probably can drop rs <
re test there but for me it just seems easier to simply check the
first iteration. If you think it's something worth changing and it
looks better afterwards, please send a patch.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2009-12-01 06:49    [W:0.072 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site