aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/xenbus/xenbus_probe_backend.c
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2016-10-31 14:58:42 +0100
committerJuergen Gross <jgross@suse.com>2016-11-07 13:55:36 +0100
commit999c9af9e3a2535d9ad41182e93eb128e587eb84 (patch)
tree06d9ceacd42148533c431960f0e32fd197a36ff3 /drivers/xen/xenbus/xenbus_probe_backend.c
parentxen: make use of xenbus_read_unsigned() in xen-pciback (diff)
downloadlinux-dev-999c9af9e3a2535d9ad41182e93eb128e587eb84.tar.xz
linux-dev-999c9af9e3a2535d9ad41182e93eb128e587eb84.zip
xen: make use of xenbus_read_unsigned() in xenbus
Use xenbus_read_unsigned() instead of xenbus_scanf() when possible. This requires to change the type of the reads from int to unsigned, but these cases have been wrong before: negative values are not allowed for the modified cases. Signed-off-by: Juergen Gross <jgross@suse.com> Acked-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'drivers/xen/xenbus/xenbus_probe_backend.c')
-rw-r--r--drivers/xen/xenbus/xenbus_probe_backend.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/xen/xenbus/xenbus_probe_backend.c b/drivers/xen/xenbus/xenbus_probe_backend.c
index 04f7f85a5edf..37929df829a3 100644
--- a/drivers/xen/xenbus/xenbus_probe_backend.c
+++ b/drivers/xen/xenbus/xenbus_probe_backend.c
@@ -224,13 +224,7 @@ static int read_frontend_details(struct xenbus_device *xendev)
int xenbus_dev_is_online(struct xenbus_device *dev)
{
- int rc, val;
-
- rc = xenbus_scanf(XBT_NIL, dev->nodename, "online", "%d", &val);
- if (rc != 1)
- val = 0; /* no online node present */
-
- return val;
+ return !!xenbus_read_unsigned(dev->nodename, "online", 0);
}
EXPORT_SYMBOL_GPL(xenbus_dev_is_online);