Commit b70c3940 authored by Matthias Kaehlcke's avatar Matthias Kaehlcke Committed by Linus Torvalds

fs/eventpoll.c: use list_for_each_entry() instead of list_for_each()

fs/eventpoll.c: use list_for_each_entry() instead of list_for_each()
in ep_poll_safewake()
Signed-off-by: default avatarMatthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent cfdaf9e5
...@@ -325,15 +325,14 @@ static void ep_poll_safewake(struct poll_safewake *psw, wait_queue_head_t *wq) ...@@ -325,15 +325,14 @@ static void ep_poll_safewake(struct poll_safewake *psw, wait_queue_head_t *wq)
int wake_nests = 0; int wake_nests = 0;
unsigned long flags; unsigned long flags;
struct task_struct *this_task = current; struct task_struct *this_task = current;
struct list_head *lsthead = &psw->wake_task_list, *lnk; struct list_head *lsthead = &psw->wake_task_list;
struct wake_task_node *tncur; struct wake_task_node *tncur;
struct wake_task_node tnode; struct wake_task_node tnode;
spin_lock_irqsave(&psw->lock, flags); spin_lock_irqsave(&psw->lock, flags);
/* Try to see if the current task is already inside this wakeup call */ /* Try to see if the current task is already inside this wakeup call */
list_for_each(lnk, lsthead) { list_for_each_entry(tncur, lsthead, llink) {
tncur = list_entry(lnk, struct wake_task_node, llink);
if (tncur->wq == wq || if (tncur->wq == wq ||
(tncur->task == this_task && ++wake_nests > EP_MAX_POLLWAKE_NESTS)) { (tncur->task == this_task && ++wake_nests > EP_MAX_POLLWAKE_NESTS)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment