[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 08/12] 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@xxxxxxxxxx
Cc: linux-pci@xxxxxxxxxxxxxxx

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
 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


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.