Commit eaf46e18 authored by Juergen Gross's avatar Juergen Gross

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

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.

Cc: tomi.valkeinen@ti.com
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Acked-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
parent 1080b38d
...@@ -633,7 +633,6 @@ static void xenfb_backend_changed(struct xenbus_device *dev, ...@@ -633,7 +633,6 @@ static void xenfb_backend_changed(struct xenbus_device *dev,
enum xenbus_state backend_state) enum xenbus_state backend_state)
{ {
struct xenfb_info *info = dev_get_drvdata(&dev->dev); struct xenfb_info *info = dev_get_drvdata(&dev->dev);
int val;
switch (backend_state) { switch (backend_state) {
case XenbusStateInitialising: case XenbusStateInitialising:
...@@ -657,16 +656,12 @@ static void xenfb_backend_changed(struct xenbus_device *dev, ...@@ -657,16 +656,12 @@ static void xenfb_backend_changed(struct xenbus_device *dev,
if (dev->state != XenbusStateConnected) if (dev->state != XenbusStateConnected)
goto InitWait; /* no InitWait seen yet, fudge it */ goto InitWait; /* no InitWait seen yet, fudge it */
if (xenbus_scanf(XBT_NIL, info->xbdev->otherend, if (xenbus_read_unsigned(info->xbdev->otherend,
"request-update", "%d", &val) < 0) "request-update", 0))
val = 0;
if (val)
info->update_wanted = 1; info->update_wanted = 1;
if (xenbus_scanf(XBT_NIL, dev->otherend, info->feature_resize = xenbus_read_unsigned(dev->otherend,
"feature-resize", "%d", &val) < 0) "feature-resize", 0);
val = 0;
info->feature_resize = val;
break; break;
case XenbusStateClosed: case XenbusStateClosed:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment