提交 a14c44d8 编写于 作者: T Tomas Winkler 提交者: Greg Kroah-Hartman

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: NTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 136698e5
...@@ -318,7 +318,6 @@ int mei_cl_link(struct mei_cl *cl, int id) ...@@ -318,7 +318,6 @@ int mei_cl_link(struct mei_cl *cl, int id)
int mei_cl_unlink(struct mei_cl *cl) int mei_cl_unlink(struct mei_cl *cl)
{ {
struct mei_device *dev; struct mei_device *dev;
struct mei_cl *pos, *next;
/* don't shout on error exit path */ /* don't shout on error exit path */
if (!cl) if (!cl)
...@@ -330,14 +329,10 @@ int mei_cl_unlink(struct mei_cl *cl) ...@@ -330,14 +329,10 @@ int mei_cl_unlink(struct mei_cl *cl)
dev = cl->dev; dev = cl->dev;
list_for_each_entry_safe(pos, next, &dev->file_list, link) { cl_dbg(dev, cl, "unlink client");
if (cl->host_client_id == pos->host_client_id) {
cl_dbg(dev, cl, "remove host client = %d, ME client = %d\n", list_del_init(&cl->link);
pos->host_client_id, pos->me_client_id);
list_del_init(&pos->link);
break;
}
}
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册