public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xenbus: prefer list_for_each()
@ 2016-07-07  7:33 Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2016-07-07  7:33 UTC (permalink / raw)
  To: david.vrabel, boris.ostrovsky, Juergen Gross; +Cc: xen-devel, linux-kernel

... over list_for_each_safe() when list modification if accompanied by
breaking out of the loop.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 drivers/xen/xenbus/xenbus_dev_frontend.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- 4.7-rc6-xen.orig/drivers/xen/xenbus/xenbus_dev_frontend.c
+++ 4.7-rc6-xen/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 m
 		}
 		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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-07 12:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <577E21EE02000078000FBDBD@suse.com>
2016-07-07 12:37 ` [PATCH] xenbus: prefer list_for_each() Juergen Gross
2016-07-07  7:33 Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox