aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/amthif.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/amthif.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/amthif.c')
-rw-r--r--drivers/misc/mei/amthif.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c
index c0fc23f16496..61275e6e839c 100644
--- a/drivers/misc/mei/amthif.c
+++ b/drivers/misc/mei/amthif.c
@@ -133,14 +133,12 @@ int mei_amthif_host_init(struct mei_device *dev)
133struct mei_cl_cb *mei_amthif_find_read_list_entry(struct mei_device *dev, 133struct mei_cl_cb *mei_amthif_find_read_list_entry(struct mei_device *dev,
134 struct file *file) 134 struct file *file)
135{ 135{
136 struct mei_cl_cb *pos = NULL; 136 struct mei_cl_cb *cb;
137 struct mei_cl_cb *next = NULL;
138 137
139 list_for_each_entry_safe(pos, next, 138 list_for_each_entry(cb, &dev->amthif_rd_complete_list.list, list) {
140 &dev->amthif_rd_complete_list.list, list) { 139 if (cb->cl && cb->cl == &dev->iamthif_cl &&
141 if (pos->cl && pos->cl == &dev->iamthif_cl && 140 cb->file_object == file)
142 pos->file_object == file) 141 return cb;
143 return pos;
144 } 142 }
145 return NULL; 143 return NULL;
146} 144}