diff options
author | Jan Beulich <JBeulich@suse.com> | 2016-10-24 09:03:49 -0600 |
---|---|---|
committer | David Vrabel <david.vrabel@citrix.com> | 2016-10-24 16:08:04 +0100 |
commit | e1e5b3ff41983f506c3cbcf123fe7d682f61a8f1 (patch) | |
tree | 8c2ef836dd61dd49e72389e6f39e332141cec5bf /drivers/xen/xenbus | |
parent | cb5f7e7c1ded5ff91b18116669c0f43c82bea3db (diff) | |
download | op-kernel-dev-e1e5b3ff41983f506c3cbcf123fe7d682f61a8f1.zip op-kernel-dev-e1e5b3ff41983f506c3cbcf123fe7d682f61a8f1.tar.gz |
xenbus: prefer list_for_each()
This is more efficient than list_for_each_safe() when list modification
is accompanied by breaking out of the loop.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'drivers/xen/xenbus')
-rw-r--r-- | drivers/xen/xenbus/xenbus_dev_frontend.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c index 7487971..fe60b12 100644 --- a/drivers/xen/xenbus/xenbus_dev_frontend.c +++ b/drivers/xen/xenbus/xenbus_dev_frontend.c @@ -364,7 +364,7 @@ out: static int xenbus_write_watch(unsigned msg_type, struct xenbus_file_priv *u) { - struct watch_adapter *watch, *tmp_watch; + struct watch_adapter *watch; char *path, *token; int err, rc; LIST_HEAD(staging_q); @@ -399,7 +399,7 @@ static int xenbus_write_watch(unsigned msg_type, struct xenbus_file_priv *u) } list_add(&watch->list, &u->watches); } else { - list_for_each_entry_safe(watch, tmp_watch, &u->watches, list) { + list_for_each_entry(watch, &u->watches, list) { if (!strcmp(watch->token, token) && !strcmp(watch->watch.node, path)) { unregister_xenbus_watch(&watch->watch); |