[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170210075523.GF6515@twins.programming.kicks-ass.net>
Date: Fri, 10 Feb 2017 08:55:23 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Byungchul Park <byungchul.park@....com>
Cc: mingo@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched: Enhance readability of iterating wake_list
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.
Powered by blists - more mailing lists