mei: amthif: use service function to flush amthif queue
authorAlexander Usyskin <alexander.usyskin@intel.com>
Thu, 14 Aug 2014 14:22:20 +0000 (17:22 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Sep 2014 05:56:16 +0000 (22:56 -0700)
Replace open coded loop with an existing service function:
mei_io_list_flush

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/client.c
drivers/misc/mei/client.h
drivers/misc/mei/interrupt.c

index 2da05c0e113d0b62d917e4de4b12e15b46defac8..3c5a1d3289774c9160d8870fbdaf7c3e13f9a1f9 100644 (file)
@@ -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);
 }
index 96d5de0389f9471e1ff7cb8ca4843d64ded0c7f9..bf2b0b1b493d52fdf9c3942cb6bf3a25e0a901cd 100644 (file)
@@ -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
  */
index 4e3cba6da3f5cccd32d4ee623f91fe5c03655816..19709b70874e0b6d4f10e847003102991aa34e05 100644 (file)
@@ -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;
 
This page took 0.027564 seconds and 5 git commands to generate.