summaryrefslogtreecommitdiffstats
path: root/drivers/pci/xen-pcifront.c
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2016-10-31 14:58:41 +0100
committerJuergen Gross <jgross@suse.com>2016-11-07 13:55:26 +0100
commit58faf07b76817782ea20c392639569ea613cd439 (patch)
tree423bd77b2d62cd6087cbf42d074157abaac49782 /drivers/pci/xen-pcifront.c
parentxen: make use of xenbus_read_unsigned() in xen-netfront (diff)
downloadlinux-58faf07b76817782ea20c392639569ea613cd439.tar.xz
linux-58faf07b76817782ea20c392639569ea613cd439.zip
xen: make use of xenbus_read_unsigned() in xen-pcifront
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> Acked-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'drivers/pci/xen-pcifront.c')
-rw-r--r--drivers/pci/xen-pcifront.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index d6ff5e82377d..8fc2e9532575 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;