diff options
author | Juergen Gross <jgross@suse.com> | 2016-10-31 14:58:42 +0100 |
---|---|---|
committer | Juergen Gross <jgross@suse.com> | 2016-11-07 13:55:36 +0100 |
commit | 999c9af9e3a2535d9ad41182e93eb128e587eb84 (patch) | |
tree | 06d9ceacd42148533c431960f0e32fd197a36ff3 /drivers/xen/xenbus/xenbus_probe_backend.c | |
parent | 4e81f1caa7ff77f7fd31bd31f84b1a0dcfc8184e (diff) | |
download | op-kernel-dev-999c9af9e3a2535d9ad41182e93eb128e587eb84.zip op-kernel-dev-999c9af9e3a2535d9ad41182e93eb128e587eb84.tar.gz |
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.c | 8 |
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 04f7f85..37929df 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); |