mei: mei_cl_unlink: no need to loop over dev list
authorTomas Winkler <tomas.winkler@intel.com>
Mon, 16 Sep 2013 20:44:45 +0000 (23:44 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Sep 2013 15:42:44 +0000 (08:42 -0700)
we can call list_del_init regardless the client is
linked or not it is always properly initialized

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

index 2ab9d1613ffcb2eb009cd8e44a9ea3cbaa99ccc7..fbd319c506e6ca471b16ff450279e94a35e279db 100644 (file)
@@ -318,7 +318,6 @@ int mei_cl_link(struct mei_cl *cl, int id)
 int mei_cl_unlink(struct mei_cl *cl)
 {
        struct mei_device *dev;
-       struct mei_cl *pos, *next;
 
        /* don't shout on error exit path */
        if (!cl)
@@ -330,14 +329,10 @@ int mei_cl_unlink(struct mei_cl *cl)
 
        dev = cl->dev;
 
-       list_for_each_entry_safe(pos, next, &dev->file_list, link) {
-               if (cl->host_client_id == pos->host_client_id) {
-                       cl_dbg(dev, cl, "remove host client = %d, ME client = %d\n",
-                               pos->host_client_id, pos->me_client_id);
-                       list_del_init(&pos->link);
-                       break;
-               }
-       }
+       cl_dbg(dev, cl, "unlink client");
+
+       list_del_init(&cl->link);
+
        return 0;
 }