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


Groups > linux.kernel > #1512699 > unrolled thread

[PATCH 08/12] xen: make use of xenbus_read_unsigned() in xen-pcifront

Started byJuergen Gross <jgross@suse.com>
First post2016-10-31 17:50 +0100
Last post2016-10-31 19:20 +0100
Articles 2 — 2 participants

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

  [PATCH 08/12] xen: make use of xenbus_read_unsigned() in xen-pcifront Juergen Gross <jgross@suse.com> - 2016-10-31 17:50 +0100
    Re: [PATCH 08/12] xen: make use of xenbus_read_unsigned() in  xen-pcifront Bjorn Helgaas <helgaas@kernel.org> - 2016-10-31 19:20 +0100

#1512699 — [PATCH 08/12] xen: make use of xenbus_read_unsigned() in xen-pcifront

FromJuergen Gross <jgross@suse.com>
Date2016-10-31 17:50 +0100
Subject[PATCH 08/12] xen: make use of xenbus_read_unsigned() in xen-pcifront
Message-ID<synWy-4Wn-29@gated-at.bofh.it>
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>
---
 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

[toc] | [next] | [standalone]


#1512770 — Re: [PATCH 08/12] xen: make use of xenbus_read_unsigned() in xen-pcifront

FromBjorn Helgaas <helgaas@kernel.org>
Date2016-10-31 19:20 +0100
SubjectRe: [PATCH 08/12] xen: make use of xenbus_read_unsigned() in xen-pcifront
Message-ID<syplD-5Zo-29@gated-at.bofh.it>
In reply to#1512699
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
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web