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_xs.c | |
parent | xen: make use of xenbus_read_unsigned() in xen-pciback (diff) | |
download | linux-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_xs.c')
-rw-r--r-- | drivers/xen/xenbus/xenbus_xs.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index 99dfdfae42c6..6afb993c5809 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c @@ -687,7 +687,7 @@ static bool xen_strict_xenbus_quirk(void) } static void xs_reset_watches(void) { - int err, supported = 0; + int err; if (!xen_hvm_domain() || xen_initial_domain()) return; @@ -695,9 +695,8 @@ static void xs_reset_watches(void) if (xen_strict_xenbus_quirk()) return; - err = xenbus_scanf(XBT_NIL, "control", - "platform-feature-xs_reset_watches", "%d", &supported); - if (err != 1 || !supported) + if (!xenbus_read_unsigned("control", + "platform-feature-xs_reset_watches", 0)) return; err = xs_error(xs_single(XBT_NIL, XS_RESET_WATCHES, "", NULL)); |