All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <JBeulich@suse.com>,
	plagnioj@jcrosoft.com, tomi.valkeinen@ti.com
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Vrabel <david.vrabel@citrix.com>,
	linux-fbdev <linux-fbdev@vger.kernel.org>
Subject: Re: [PATCH] xen-fbfront: correct return value checks on xenbus_scanf()
Date: Thu, 07 Jul 2016 09:42:53 +0000	[thread overview]
Message-ID: <577E241D.8040908@suse.com> (raw)
In-Reply-To: <577E258502000078000FBE6F@suse.com>

On 07/07/16 09:48, Jan Beulich wrote:
> Only a positive return value indicates success.

Hmm, I'm not convinced on this change (and the similar others as
well). From xenbus.h:

/* Single read and scanf: returns -errno or num scanned if > 0. */

There should be no case for xenbus_scanf() returning 0. And looking
into the functions proofs this is correct.


Juergen

> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
>  drivers/video/fbdev/xen-fbfront.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- 4.7-rc6-xenbus_scanf.orig/drivers/video/fbdev/xen-fbfront.c
> +++ 4.7-rc6-xenbus_scanf/drivers/video/fbdev/xen-fbfront.c
> @@ -658,13 +658,13 @@ InitWait:
>  			goto InitWait; /* no InitWait seen yet, fudge it */
>  
>  		if (xenbus_scanf(XBT_NIL, info->xbdev->otherend,
> -				 "request-update", "%d", &val) < 0)
> +				 "request-update", "%d", &val) <= 0)
>  			val = 0;
>  		if (val)
>  			info->update_wanted = 1;
>  
>  		if (xenbus_scanf(XBT_NIL, dev->otherend,
> -				 "feature-resize", "%d", &val) < 0)
> +				 "feature-resize", "%d", &val) <= 0)
>  			val = 0;
>  		info->feature_resize = val;
>  		break;
> 
> 


WARNING: multiple messages have this Message-ID (diff)
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <JBeulich@suse.com>,
	plagnioj@jcrosoft.com, tomi.valkeinen@ti.com
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Vrabel <david.vrabel@citrix.com>,
	linux-fbdev <linux-fbdev@vger.kernel.org>
Subject: Re: [PATCH] xen-fbfront: correct return value checks on xenbus_scanf()
Date: Thu, 7 Jul 2016 11:42:53 +0200	[thread overview]
Message-ID: <577E241D.8040908@suse.com> (raw)
In-Reply-To: <577E258502000078000FBE6F@suse.com>

On 07/07/16 09:48, Jan Beulich wrote:
> Only a positive return value indicates success.

Hmm, I'm not convinced on this change (and the similar others as
well). From xenbus.h:

/* Single read and scanf: returns -errno or num scanned if > 0. */

There should be no case for xenbus_scanf() returning 0. And looking
into the functions proofs this is correct.


Juergen

> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
>  drivers/video/fbdev/xen-fbfront.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- 4.7-rc6-xenbus_scanf.orig/drivers/video/fbdev/xen-fbfront.c
> +++ 4.7-rc6-xenbus_scanf/drivers/video/fbdev/xen-fbfront.c
> @@ -658,13 +658,13 @@ InitWait:
>  			goto InitWait; /* no InitWait seen yet, fudge it */
>  
>  		if (xenbus_scanf(XBT_NIL, info->xbdev->otherend,
> -				 "request-update", "%d", &val) < 0)
> +				 "request-update", "%d", &val) <= 0)
>  			val = 0;
>  		if (val)
>  			info->update_wanted = 1;
>  
>  		if (xenbus_scanf(XBT_NIL, dev->otherend,
> -				 "feature-resize", "%d", &val) < 0)
> +				 "feature-resize", "%d", &val) <= 0)
>  			val = 0;
>  		info->feature_resize = val;
>  		break;
> 
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

       reply	other threads:[~2016-07-07  9:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <577E258502000078000FBE6F@suse.com>
2016-07-07  9:42 ` Juergen Gross [this message]
2016-07-07  9:42   ` [PATCH] xen-fbfront: correct return value checks on xenbus_scanf() Juergen Gross
2016-07-07 10:03   ` Jan Beulich
2016-07-07 10:03     ` Jan Beulich
2016-07-07  7:48 Jan Beulich
2016-07-07  7:48 ` Jan Beulich
2016-07-07  9:46 ` David Vrabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=577E241D.8040908@suse.com \
    --to=jgross@suse.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=plagnioj@jcrosoft.com \
    --cc=tomi.valkeinen@ti.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.