From 5456796b1a2aedd2d6345944b73ac41aeb8cb589 Mon Sep 17 00:00:00 2001 From: Alexander Usyskin Date: Thu, 14 Aug 2014 17:22:20 +0300 Subject: [PATCH] mei: amthif: use service function to flush amthif queue Replace open coded loop with an existing service function: mei_io_list_flush Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman --- drivers/misc/mei/client.c | 2 +- drivers/misc/mei/client.h | 2 ++ drivers/misc/mei/interrupt.c | 13 ++----------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c index 2da05c0e113d..3c5a1d328977 100644 --- a/drivers/misc/mei/client.c +++ b/drivers/misc/mei/client.c @@ -117,7 +117,7 @@ static void __mei_io_list_flush(struct mei_cl_cb *list, * @list: An instance of our list structure * @cl: host client */ -static inline void mei_io_list_flush(struct mei_cl_cb *list, struct mei_cl *cl) +void mei_io_list_flush(struct mei_cl_cb *list, struct mei_cl *cl) { __mei_io_list_flush(list, cl, false); } diff --git a/drivers/misc/mei/client.h b/drivers/misc/mei/client.h index 96d5de0389f9..bf2b0b1b493d 100644 --- a/drivers/misc/mei/client.h +++ b/drivers/misc/mei/client.h @@ -45,6 +45,8 @@ static inline void mei_io_list_init(struct mei_cl_cb *list) { INIT_LIST_HEAD(&list->list); } +void mei_io_list_flush(struct mei_cl_cb *list, struct mei_cl *cl); + /* * MEI Host Client Functions */ diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index 4e3cba6da3f5..19709b70874e 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c @@ -556,8 +556,6 @@ void mei_timer(struct work_struct *work) { unsigned long timeout; struct mei_cl *cl; - struct mei_cl_cb *cb_pos = NULL; - struct mei_cl_cb *cb_next = NULL; struct mei_device *dev = container_of(work, struct mei_device, timer_work.work); @@ -632,15 +630,8 @@ void mei_timer(struct work_struct *work) dev_dbg(&dev->pdev->dev, "freeing AMTHI for other requests\n"); - list_for_each_entry_safe(cb_pos, cb_next, - &dev->amthif_rd_complete_list.list, list) { - - cl = cb_pos->file_object->private_data; - - /* Finding the AMTHI entry. */ - if (cl == &dev->iamthif_cl) - list_del(&cb_pos->list); - } + mei_io_list_flush(&dev->amthif_rd_complete_list, + &dev->iamthif_cl); mei_io_cb_free(dev->iamthif_current_cb); dev->iamthif_current_cb = NULL;