projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb5f7e7
)
xenbus: prefer list_for_each()
author
Jan Beulich
<JBeulich@suse.com>
Mon, 24 Oct 2016 15:03:49 +0000
(09:03 -0600)
committer
David Vrabel
<david.vrabel@citrix.com>
Mon, 24 Oct 2016 15:08:04 +0000
(16:08 +0100)
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>
drivers/xen/xenbus/xenbus_dev_frontend.c
patch
|
blob
|
history
diff --git
a/drivers/xen/xenbus/xenbus_dev_frontend.c
b/drivers/xen/xenbus/xenbus_dev_frontend.c
index 7487971f9f788b12a637216c29cc853bb933c1ca..fe60b12de92043575a0893b5c139e850472efdda 100644
(file)
--- 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);