aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/hbm.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2014-02-17 08:13:25 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-18 13:06:08 -0500
commit31f88f5739e966cb3c524083e2d19b423ece3585 (patch)
tree107ffaf65a3000ec8592164a91e084cc6d155a6d /drivers/misc/mei/hbm.c
parent12d0066526f386538de80b4d86d2008461b36674 (diff)
mei: don't of list_for_each_entry_safe when not deleting
We can use simply list_for_each_entry if there is no entry removal Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/hbm.c')
-rw-r--r--drivers/misc/mei/hbm.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c
index 7e99e4149626..a28cc928fb02 100644
--- a/drivers/misc/mei/hbm.c
+++ b/drivers/misc/mei/hbm.c
@@ -380,8 +380,7 @@ static int mei_hbm_add_single_flow_creds(struct mei_device *dev,
380static void mei_hbm_cl_flow_control_res(struct mei_device *dev, 380static void mei_hbm_cl_flow_control_res(struct mei_device *dev,
381 struct hbm_flow_control *flow_control) 381 struct hbm_flow_control *flow_control)
382{ 382{
383 struct mei_cl *cl = NULL; 383 struct mei_cl *cl;
384 struct mei_cl *next = NULL;
385 384
386 if (!flow_control->host_addr) { 385 if (!flow_control->host_addr) {
387 /* single receive buffer */ 386 /* single receive buffer */
@@ -390,7 +389,7 @@ static void mei_hbm_cl_flow_control_res(struct mei_device *dev,
390 } 389 }
391 390
392 /* normal connection */ 391 /* normal connection */
393 list_for_each_entry_safe(cl, next, &dev->file_list, link) { 392 list_for_each_entry(cl, &dev->file_list, link) {
394 if (mei_hbm_cl_addr_equal(cl, flow_control)) { 393 if (mei_hbm_cl_addr_equal(cl, flow_control)) {
395 cl->mei_flow_ctrl_creds++; 394 cl->mei_flow_ctrl_creds++;
396 dev_dbg(&dev->pdev->dev, "flow ctrl msg for host %d ME %d.\n", 395 dev_dbg(&dev->pdev->dev, "flow ctrl msg for host %d ME %d.\n",
@@ -557,10 +556,10 @@ static void mei_hbm_cl_connect_res(struct mei_device *dev,
557static int mei_hbm_fw_disconnect_req(struct mei_device *dev, 556static int mei_hbm_fw_disconnect_req(struct mei_device *dev,
558 struct hbm_client_connect_request *disconnect_req) 557 struct hbm_client_connect_request *disconnect_req)
559{ 558{
560 struct mei_cl *cl, *next; 559 struct mei_cl *cl;
561 struct mei_cl_cb *cb; 560 struct mei_cl_cb *cb;
562 561
563 list_for_each_entry_safe(cl, next, &dev->file_list, link) { 562 list_for_each_entry(cl, &dev->file_list, link) {
564 if (mei_hbm_cl_addr_equal(cl, disconnect_req)) { 563 if (mei_hbm_cl_addr_equal(cl, disconnect_req)) {
565 dev_dbg(&dev->pdev->dev, "disconnect request host client %d ME client %d.\n", 564 dev_dbg(&dev->pdev->dev, "disconnect request host client %d ME client %d.\n",
566 disconnect_req->host_addr, 565 disconnect_req->host_addr,