lkml.org 
[lkml]   [2017]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched: Enhance readability of iterating wake_list
On Fri, Feb 10, 2017 at 08:55:23AM +0100, Peter Zijlstra wrote:
> On Fri, Feb 10, 2017 at 01:09:31PM +0900, Byungchul Park wrote:
> > +#define for_each_wake_list(task, node) \
> > + for ((task) = llist_entry((node), struct task_struct, wake_entry); \
> > + node; (node) = llist_next(node), \
> > + (task) = llist_entry((node), struct task_struct, wake_entry))
> > +
>
> How about you make that llist_for_each(pos, member) or similar and
> replace all while (foo) { foo = llist_next(foo); } instances?
>
> Because most llist_next() users have the same pattern.

Yes, it would be better. I will do it.

Thank you.

\
 
 \ /
  Last update: 2017-02-10 11:12    [W:0.043 / U:2.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site