From 31f88f5739e966cb3c524083e2d19b423ece3585 Mon Sep 17 00:00:00 2001 From: Tomas Winkler Date: Mon, 17 Feb 2014 15:13:25 +0200 Subject: mei: don't of list_for_each_entry_safe when not deleting We can use simply list_for_each_entry if there is no entry removal Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman --- drivers/misc/mei/interrupt.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'drivers/misc/mei/interrupt.c') diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index 61ceb781cd20..6c4597e9b997 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c @@ -574,8 +574,7 @@ EXPORT_SYMBOL_GPL(mei_irq_write_handler); void mei_timer(struct work_struct *work) { unsigned long timeout; - struct mei_cl *cl_pos = NULL; - struct mei_cl *cl_next = NULL; + struct mei_cl *cl; struct mei_cl_cb *cb_pos = NULL; struct mei_cl_cb *cb_next = NULL; @@ -603,9 +602,9 @@ void mei_timer(struct work_struct *work) goto out; /*** connect/disconnect timeouts ***/ - list_for_each_entry_safe(cl_pos, cl_next, &dev->file_list, link) { - if (cl_pos->timer_count) { - if (--cl_pos->timer_count == 0) { + list_for_each_entry(cl, &dev->file_list, link) { + if (cl->timer_count) { + if (--cl->timer_count == 0) { dev_err(&dev->pdev->dev, "timer: connect/disconnect timeout.\n"); mei_reset(dev); goto out; @@ -655,10 +654,10 @@ void mei_timer(struct work_struct *work) list_for_each_entry_safe(cb_pos, cb_next, &dev->amthif_rd_complete_list.list, list) { - cl_pos = cb_pos->file_object->private_data; + cl = cb_pos->file_object->private_data; /* Finding the AMTHI entry. */ - if (cl_pos == &dev->iamthif_cl) + if (cl == &dev->iamthif_cl) list_del(&cb_pos->list); } mei_io_cb_free(dev->iamthif_current_cb); -- cgit v1.2.3-58-ga151