mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 21:51:40 +00:00
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>
This commit is contained in:
parent
2890ea5c13
commit
58faf07b76
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user