Commit 5456796b authored by Alexander Usyskin's avatar Alexander Usyskin Committed by Greg Kroah-Hartman

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: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2c2b93ec
...@@ -117,7 +117,7 @@ static void __mei_io_list_flush(struct mei_cl_cb *list, ...@@ -117,7 +117,7 @@ static void __mei_io_list_flush(struct mei_cl_cb *list,
* @list: An instance of our list structure * @list: An instance of our list structure
* @cl: host client * @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); __mei_io_list_flush(list, cl, false);
} }
......
...@@ -45,6 +45,8 @@ static inline void mei_io_list_init(struct mei_cl_cb *list) ...@@ -45,6 +45,8 @@ static inline void mei_io_list_init(struct mei_cl_cb *list)
{ {
INIT_LIST_HEAD(&list->list); INIT_LIST_HEAD(&list->list);
} }
void mei_io_list_flush(struct mei_cl_cb *list, struct mei_cl *cl);
/* /*
* MEI Host Client Functions * MEI Host Client Functions
*/ */
......
...@@ -556,8 +556,6 @@ void mei_timer(struct work_struct *work) ...@@ -556,8 +556,6 @@ void mei_timer(struct work_struct *work)
{ {
unsigned long timeout; unsigned long timeout;
struct mei_cl *cl; 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 *dev = container_of(work,
struct mei_device, timer_work.work); struct mei_device, timer_work.work);
...@@ -632,15 +630,8 @@ void mei_timer(struct work_struct *work) ...@@ -632,15 +630,8 @@ void mei_timer(struct work_struct *work)
dev_dbg(&dev->pdev->dev, "freeing AMTHI for other requests\n"); dev_dbg(&dev->pdev->dev, "freeing AMTHI for other requests\n");
list_for_each_entry_safe(cb_pos, cb_next, mei_io_list_flush(&dev->amthif_rd_complete_list,
&dev->amthif_rd_complete_list.list, list) { &dev->iamthif_cl);
cl = cb_pos->file_object->private_data;
/* Finding the AMTHI entry. */
if (cl == &dev->iamthif_cl)
list_del(&cb_pos->list);
}
mei_io_cb_free(dev->iamthif_current_cb); mei_io_cb_free(dev->iamthif_current_cb);
dev->iamthif_current_cb = NULL; dev->iamthif_current_cb = NULL;
......
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