Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Juergen Gross <jgross@suse.com>
Acked-by: David Vrabel <david.vrabel@citrix.com>

+4 -9
+4 -9
drivers/video/fbdev/xen-fbfront.c
··· 633 633 enum xenbus_state backend_state) 634 634 { 635 635 struct xenfb_info *info = dev_get_drvdata(&dev->dev); 636 - int val; 637 636 638 637 switch (backend_state) { 639 638 case XenbusStateInitialising: ··· 656 657 if (dev->state != XenbusStateConnected) 657 658 goto InitWait; /* no InitWait seen yet, fudge it */ 658 659 659 - if (xenbus_scanf(XBT_NIL, info->xbdev->otherend, 660 - "request-update", "%d", &val) < 0) 661 - val = 0; 662 - if (val) 660 + if (xenbus_read_unsigned(info->xbdev->otherend, 661 + "request-update", 0)) 663 662 info->update_wanted = 1; 664 663 665 - if (xenbus_scanf(XBT_NIL, dev->otherend, 666 - "feature-resize", "%d", &val) < 0) 667 - val = 0; 668 - info->feature_resize = val; 664 + info->feature_resize = xenbus_read_unsigned(dev->otherend, 665 + "feature-resize", 0); 669 666 break; 670 667 671 668 case XenbusStateClosed: