From: Bjorn Helgaas <helgaas@kernel.org>
To: Juergen Gross <jgross@suse.com>
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xen.org,
david.vrabel@citrix.com, boris.ostrovsky@oracle.com,
bhelgaas@google.com, linux-pci@vger.kernel.org
Subject: Re: [PATCH 08/12] xen: make use of xenbus_read_unsigned() in xen-pcifront
Date: Mon, 31 Oct 2016 13:18:49 -0500 [thread overview]
Message-ID: <20161031181849.GA11486@bhelgaas-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <1477932510-28594-9-git-send-email-jgross@suse.com>
On Mon, Oct 31, 2016 at 05:48:26PM +0100, Juergen Gross wrote:
> Use xenbus_read_unsigned() instead of xenbus_scanf() when possible.
> This requires to change the type of the read from int to unsigned,
> but this case has been wrong before: negative values are not allowed
> for the modified case.
>
> Cc: bhelgaas@google.com
> Cc: linux-pci@vger.kernel.org
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
I assume this will be merged with the rest of the series via some tree
other than mine.
> ---
> drivers/pci/xen-pcifront.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
> index d6ff5e8..8fc2e95 100644
> --- a/drivers/pci/xen-pcifront.c
> +++ b/drivers/pci/xen-pcifront.c
> @@ -1038,10 +1038,8 @@ static int pcifront_detach_devices(struct pcifront_device *pdev)
> err = -ENOMEM;
> goto out;
> }
> - err = xenbus_scanf(XBT_NIL, pdev->xdev->otherend, str, "%d",
> - &state);
> - if (err != 1)
> - state = XenbusStateUnknown;
> + state = xenbus_read_unsigned(pdev->xdev->otherend, str,
> + XenbusStateUnknown);
>
> if (state != XenbusStateClosing)
> continue;
> --
> 2.6.6
>
next prev parent reply other threads:[~2016-10-31 18:18 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-31 16:48 [PATCH 00/12] xen: add common function for reading optional value Juergen Gross
2016-10-31 16:48 ` [PATCH 01/12] xen: introduce xenbus_read_unsigned() Juergen Gross
2016-11-07 11:02 ` [Xen-devel] " David Vrabel
2016-10-31 16:48 ` [PATCH 02/12] xen: make use of xenbus_read_unsigned() in xen-blkback Juergen Gross
2016-10-31 16:48 ` [PATCH 03/12] xen: make use of xenbus_read_unsigned() in xen-blkfront Juergen Gross
2016-10-31 16:48 ` [PATCH 04/12] xen: make use of xenbus_read_unsigned() in xen-tpmfront Juergen Gross
2016-11-02 10:34 ` Jarkko Sakkinen
2016-11-04 4:26 ` Jarkko Sakkinen
2016-10-31 16:48 ` [PATCH 05/12] xen: make use of xenbus_read_unsigned() in xen-kbdfront Juergen Gross
2016-11-09 0:29 ` Dmitry Torokhov
2016-10-31 16:48 ` [PATCH 06/12] xen: make use of xenbus_read_unsigned() in xen-netback Juergen Gross
2016-11-01 9:42 ` Paul Durrant
2016-10-31 16:48 ` [PATCH 07/12] xen: make use of xenbus_read_unsigned() in xen-netfront Juergen Gross
2016-10-31 16:48 ` [PATCH 08/12] xen: make use of xenbus_read_unsigned() in xen-pcifront Juergen Gross
2016-10-31 18:18 ` Bjorn Helgaas [this message]
2016-10-31 16:48 ` [PATCH 09/12] xen: make use of xenbus_read_unsigned() in xen-scsifront Juergen Gross
2016-10-31 16:48 ` [PATCH 10/12] xen: make use of xenbus_read_unsigned() in xen-fbfront Juergen Gross
2016-10-31 16:48 ` [PATCH 11/12] xen: make use of xenbus_read_unsigned() in xen-pciback Juergen Gross
2016-10-31 16:48 ` [PATCH 12/12] xen: make use of xenbus_read_unsigned() in xenbus Juergen Gross
2016-10-31 17:08 ` [PATCH 00/12] xen: add common function for reading optional value David Miller
2016-11-01 4:33 ` Juergen Gross
2016-11-07 11:08 ` David Vrabel
2016-11-07 16:20 ` Jarkko Sakkinen
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=20161031181849.GA11486@bhelgaas-glaptop.roam.corp.google.com \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).