Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1438564 > unrolled thread

Re: [PATCH] xenbus: prefer list_for_each()

Started byJuergen Gross <jgross@suse.com>
First post2016-07-07 14:40 +0200
Last post2016-07-07 14:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] xenbus: prefer list_for_each() Juergen Gross <jgross@suse.com> - 2016-07-07 14:40 +0200

#1438564 — Re: [PATCH] xenbus: prefer list_for_each()

FromJuergen Gross <jgross@suse.com>
Date2016-07-07 14:40 +0200
SubjectRe: [PATCH] xenbus: prefer list_for_each()
Message-ID<rSgKZ-6TO-11@gated-at.bofh.it>
On 07/07/16 09:33, Jan Beulich wrote:
> ... over list_for_each_safe() when list modification if accompanied by
> breaking out of the loop.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Juergen Gross <jgross@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);
> 
> 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web