Skip to content

Commit

Permalink
fs/eventpoll.c: use list_for_each_entry() instead of list_for_each()
Browse files Browse the repository at this point in the history
fs/eventpoll.c: use list_for_each_entry() instead of list_for_each()
in ep_poll_safewake()

Signed-off-by: Matthias Kaehlcke <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Matthias Kaehlcke authored and Linus Torvalds committed Oct 19, 2007
1 parent cfdaf9e commit b70c394
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/eventpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,14 @@ static void ep_poll_safewake(struct poll_safewake *psw, wait_queue_head_t *wq)
int wake_nests = 0;
unsigned long flags;
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 tnode;

spin_lock_irqsave(&psw->lock, flags);

/* Try to see if the current task is already inside this wakeup call */
list_for_each(lnk, lsthead) {
tncur = list_entry(lnk, struct wake_task_node, llink);
list_for_each_entry(tncur, lsthead, llink) {

if (tncur->wq == wq ||
(tncur->task == this_task && ++wake_nests > EP_MAX_POLLWAKE_NESTS)) {
Expand Down

0 comments on commit b70c394

Please sign in to comment.