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

Commit 4e81f1ca authored by Juergen Gross's avatar Juergen Gross
Browse files

xen: make use of xenbus_read_unsigned() in xen-pciback



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.

Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Acked-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
parent eaf46e18
Loading
Loading
Loading
Loading
+3 −5
Original line number Original line Diff line number Diff line
@@ -362,7 +362,7 @@ static int xen_pcibk_reconfigure(struct xen_pcibk_device *pdev)
	int err = 0;
	int err = 0;
	int num_devs;
	int num_devs;
	int domain, bus, slot, func;
	int domain, bus, slot, func;
	int substate;
	unsigned int substate;
	int i, len;
	int i, len;
	char state_str[64];
	char state_str[64];
	char dev_str[64];
	char dev_str[64];
@@ -395,10 +395,8 @@ static int xen_pcibk_reconfigure(struct xen_pcibk_device *pdev)
					 "configuration");
					 "configuration");
			goto out;
			goto out;
		}
		}
		err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, state_str,
		substate = xenbus_read_unsigned(pdev->xdev->nodename, state_str,
				   "%d", &substate);
						XenbusStateUnknown);
		if (err != 1)
			substate = XenbusStateUnknown;


		switch (substate) {
		switch (substate) {
		case XenbusStateInitialising:
		case XenbusStateInitialising: