diff mbox

[05/19] libusb: using error_report instead of fprintf

Message ID 1411032780-10692-6-git-send-email-arei.gonglei@huawei.com
State New
Headers show

Commit Message

Gonglei (Arei) Sept. 18, 2014, 9:32 a.m. UTC
From: Gonglei <arei.gonglei@huawei.com>

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 hw/usb/host-libusb.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Paolo Bonzini Sept. 18, 2014, 10:12 a.m. UTC | #1
Il 18/09/2014 11:32, arei.gonglei@huawei.com ha scritto:
> From: Gonglei <arei.gonglei@huawei.com>
> 
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
>  hw/usb/host-libusb.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
> index 863be64..0650910 100644
> --- a/hw/usb/host-libusb.c
> +++ b/hw/usb/host-libusb.c
> @@ -275,7 +275,7 @@ static void usb_host_libusb_error(const char *func, int rc)
>      } else {
>          errname = "?";
>      }
> -    fprintf(stderr, "%s: %d [%s]\n", func, rc, errname);
> +    error_report("%s: %d [%s]", func, rc, errname);
>  }
>  
>  /* ------------------------------------------------------------------------ */
> @@ -1376,14 +1376,13 @@ static int usb_host_alloc_streams(USBDevice *udev, USBEndpoint **eps,
>      if (rc < 0) {
>          usb_host_libusb_error("libusb_alloc_streams", rc);
>      } else if (rc != streams) {
> -        fprintf(stderr,
> -            "libusb_alloc_streams: got less streams then requested %d < %d\n",
> -            rc, streams);
> +        error_report("libusb_alloc_streams: got less streams "
> +                     "then requested %d < %d", rc, streams);
>      }
>  
>      return (rc == streams) ? 0 : -1;
>  #else
> -    fprintf(stderr, "libusb_alloc_streams: error not implemented\n");
> +    error_report("libusb_alloc_streams: error not implemented");
>      return -1;
>  #endif
>  }
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
diff mbox

Patch

diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 863be64..0650910 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -275,7 +275,7 @@  static void usb_host_libusb_error(const char *func, int rc)
     } else {
         errname = "?";
     }
-    fprintf(stderr, "%s: %d [%s]\n", func, rc, errname);
+    error_report("%s: %d [%s]", func, rc, errname);
 }
 
 /* ------------------------------------------------------------------------ */
@@ -1376,14 +1376,13 @@  static int usb_host_alloc_streams(USBDevice *udev, USBEndpoint **eps,
     if (rc < 0) {
         usb_host_libusb_error("libusb_alloc_streams", rc);
     } else if (rc != streams) {
-        fprintf(stderr,
-            "libusb_alloc_streams: got less streams then requested %d < %d\n",
-            rc, streams);
+        error_report("libusb_alloc_streams: got less streams "
+                     "then requested %d < %d", rc, streams);
     }
 
     return (rc == streams) ? 0 : -1;
 #else
-    fprintf(stderr, "libusb_alloc_streams: error not implemented\n");
+    error_report("libusb_alloc_streams: error not implemented");
     return -1;
 #endif
 }