mei: mei_clear_list: kill file_temp
authorTomas Winkler <tomas.winkler@intel.com>
Thu, 1 Nov 2012 19:17:16 +0000 (21:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Nov 2012 19:31:19 +0000 (12:31 -0700)
file_temp is used only once, so there is no any benefit of creating
a temporary variable

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/main.c

index f69e0856f982b1782c8d4724593a44fc45009525..d8221a5a7ee8644c29b71536665b3124659790ba 100644 (file)
@@ -103,18 +103,16 @@ static DEFINE_MUTEX(mei_mutex);
  * returns true if callback removed from the list, false otherwise
  */
 static bool mei_clear_list(struct mei_device *dev,
-               struct file *file, struct list_head *mei_cb_list)
+               const struct file *file, struct list_head *mei_cb_list)
 {
        struct mei_cl_cb *cb_pos = NULL;
        struct mei_cl_cb *cb_next = NULL;
-       struct file *file_temp;
        bool removed = false;
 
        /* list all list member */
        list_for_each_entry_safe(cb_pos, cb_next, mei_cb_list, list) {
-               file_temp = (struct file *)cb_pos->file_object;
                /* check if list member associated with a file */
-               if (file_temp == file) {
+               if (file == cb_pos->file_object) {
                        /* remove member from the list */
                        list_del(&cb_pos->list);
                        /* check if cb equal to current iamthif cb */