public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Dan Carpenter <error27@gmail.com>,
	xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org
Subject: Re: [Xen-devel] [PATCH 2/9] xen/pciback: Return proper error code from sscanf.
Date: Mon, 3 Oct 2011 12:18:09 -0400	[thread overview]
Message-ID: <20111003161809.GD17108@phenom.oracle.com> (raw)
In-Reply-To: <4E858FB60200007800058A99@nat28.tlf.novell.com>

On Fri, Sep 30, 2011 at 08:45:26AM +0100, Jan Beulich wrote:
> >>> On 29.09.11 at 21:52, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > . instead of just hardcoding it to be -EINVAL.
> > 
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > ---
> >  drivers/xen/xen-pciback/pci_stub.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/xen/xen-pciback/pci_stub.c 
> > b/drivers/xen/xen-pciback/pci_stub.c
> > index 32d6891..d985b65 100644
> > --- a/drivers/xen/xen-pciback/pci_stub.c
> > +++ b/drivers/xen/xen-pciback/pci_stub.c
> > @@ -868,7 +868,7 @@ static inline int str_to_slot(const char *buf, int 
> > *domain, int *bus,
> >  	if (err == 4)
> >  		return 0;
> >  	else if (err < 0)
> > -		return -EINVAL;
> > +		return err;
> >  
> >  	/* try again without domain */
> >  	*domain = 0;
> 
> This should then also be done for the final return from the function:
> 
> 	return err < 0 ? err : -EINVAL;
> 
> But: Where did you read that {v,}sscanf() would return -E... values in
> hypothetical error cases? The C standard says it would return EOF
> when reaching the end of the input string before doing the first
> conversion; lib/vsprintf.c doesn't do so, and also doesn't say it might
> return -E... codes. Bottom line is that I think the code is more correct
> the way it is without this change.

will drop the patch..

  reply	other threads:[~2011-10-03 16:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29 19:52 [PATCH] Xen bug-fixes for 3.2 (v1) Konrad Rzeszutek Wilk
2011-09-29 19:52 ` [PATCH 1/9] xen/pciback: Do not dereference psdev during printk when it is NULL Konrad Rzeszutek Wilk
2011-09-30  7:31   ` [Xen-devel] " Jan Beulich
2011-10-03 16:14     ` Konrad Rzeszutek Wilk
2011-09-29 19:52 ` [PATCH 2/9] xen/pciback: Return proper error code from sscanf Konrad Rzeszutek Wilk
2011-09-30  7:45   ` [Xen-devel] " Jan Beulich
2011-10-03 16:18     ` Konrad Rzeszutek Wilk [this message]
2011-09-29 19:52 ` [PATCH 3/9] xen/pciback: Check if the device is found instead of blindly assuming so Konrad Rzeszutek Wilk
2011-09-30  7:50   ` [Xen-devel] " Jan Beulich
2011-09-29 19:52 ` [PATCH 4/9] xen/events: BUG() when we can't allocate our event->irq array Konrad Rzeszutek Wilk
2011-09-30  7:55   ` [Xen-devel] " Ian Campbell
2011-10-03 16:21     ` Konrad Rzeszutek Wilk
2011-09-29 19:52 ` [PATCH 5/9] xen/events: Don't check the info for NULL as it is already done Konrad Rzeszutek Wilk
2011-09-29 19:52 ` [PATCH 6/9] xen/irq: If we fail during msi_capability_init return proper error code Konrad Rzeszutek Wilk
2011-09-29 19:52 ` [PATCH 7/9] xen/xenbus: Check before dereferencing it Konrad Rzeszutek Wilk
2011-09-30  8:01   ` [Xen-devel] " Ian Campbell
2011-10-03 16:26     ` Konrad Rzeszutek Wilk
2011-09-29 19:52 ` [PATCH 8/9] xen/enlighten: Fix compile warnings Konrad Rzeszutek Wilk
2011-09-30  8:10   ` [Xen-devel] " Ian Campbell
2011-10-03 16:30     ` Konrad Rzeszutek Wilk
2011-09-29 19:52 ` [PATCH 9/9] xen/p2m/debugfs: Fix potential pointer exception Konrad Rzeszutek Wilk
2011-09-30  8:18   ` [Xen-devel] " Ian Campbell
2011-10-03 16:37     ` Konrad Rzeszutek Wilk

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=20111003161809.GD17108@phenom.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=error27@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xensource.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox