Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58faf07b authored by Juergen Gross's avatar Juergen Gross
Browse files

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: default avatarJuergen Gross <jgross@suse.com>
Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
parent 2890ea5c
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -1038,10 +1038,8 @@ static int pcifront_detach_devices(struct pcifront_device *pdev)
			err = -ENOMEM;
			err = -ENOMEM;
			goto out;
			goto out;
		}
		}
		err = xenbus_scanf(XBT_NIL, pdev->xdev->otherend, str, "%d",
		state = xenbus_read_unsigned(pdev->xdev->otherend, str,
				   &state);
					     XenbusStateUnknown);
		if (err != 1)
			state = XenbusStateUnknown;


		if (state != XenbusStateClosing)
		if (state != XenbusStateClosing)
			continue;
			continue;