summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2013-09-16 16:44:45 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-26 11:42:44 -0400
commita14c44d82fcff280fd1138574d4480b2bdd40216 (patch)
treecddd0f389008b1a6e5e5ebf8735f52a3fa78ecec
parent136698e535cd1ce59e436cc084b41370fd8f1eff (diff)
mei: mei_cl_unlink: no need to loop over dev list
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>
-rw-r--r--drivers/misc/mei/client.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index 2ab9d1613ffc..fbd319c506e6 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -318,7 +318,6 @@ int mei_cl_link(struct mei_cl *cl, int id)
318int mei_cl_unlink(struct mei_cl *cl) 318int mei_cl_unlink(struct mei_cl *cl)
319{ 319{
320 struct mei_device *dev; 320 struct mei_device *dev;
321 struct mei_cl *pos, *next;
322 321
323 /* don't shout on error exit path */ 322 /* don't shout on error exit path */
324 if (!cl) 323 if (!cl)
@@ -330,14 +329,10 @@ int mei_cl_unlink(struct mei_cl *cl)
330 329
331 dev = cl->dev; 330 dev = cl->dev;
332 331
333 list_for_each_entry_safe(pos, next, &dev->file_list, link) { 332 cl_dbg(dev, cl, "unlink client");
334 if (cl->host_client_id == pos->host_client_id) { 333
335 cl_dbg(dev, cl, "remove host client = %d, ME client = %d\n", 334 list_del_init(&cl->link);
336 pos->host_client_id, pos->me_client_id); 335
337 list_del_init(&pos->link);
338 break;
339 }
340 }
341 return 0; 336 return 0;
342} 337}
343 338