From bb30fa039fe432137e4ec607f1e47239da96f964 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 22 Jul 2015 15:46:43 -0600 Subject: [PATCH] Fix a warning detected by tools/tesbuild.sh. function was not returning the correct value in the case of errors --- arch | 2 +- drivers/usbhost/usbhost_hidmouse.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch b/arch index 0321c31ebbf..a5d40065076 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 0321c31ebbf4e8f03f84652f6d168272e5b003bf +Subproject commit a5d400650765ca63bccd82101f5b60d4f9631015 diff --git a/drivers/usbhost/usbhost_hidmouse.c b/drivers/usbhost/usbhost_hidmouse.c index 3a6ee2d7098..62c659a5b15 100644 --- a/drivers/usbhost/usbhost_hidmouse.c +++ b/drivers/usbhost/usbhost_hidmouse.c @@ -1053,7 +1053,7 @@ static int usbhost_mouse_poll(int argc, char *argv[]) #endif unsigned int nerrors = 0; ssize_t nbytes; - int ret; + int ret = OK; uvdbg("Started\n"); @@ -1100,7 +1100,9 @@ static int usbhost_mouse_poll(int argc, char *argv[]) * long time). */ - udbg("ERROR: DRVR_TRANSFER returned: %d/%d\n", ret, nerrors); + udbg("ERROR: DRVR_TRANSFER returned: %d/%u\n", + (int)nbytes, nerrors); + if (nbytes != -EAGAIN) { if (++nerrors > 200) @@ -1268,7 +1270,7 @@ static int usbhost_mouse_poll(int argc, char *argv[]) } irqrestore(flags); - return 0; + return ret; } /****************************************************************************