[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] Silence warnings (was: [5441] Add USB sys file-syst
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH] Silence warnings (was: [5441] Add USB sys file-system support (v8) (TJ)) |
Date: |
Fri, 24 Oct 2008 14:14:24 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
Anthony Liguori wrote:
> Revision: 5441
> http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5441
> Author: aliguori
> Date: 2008-10-07 20:06:37 +0000 (Tue, 07 Oct 2008)
>
> Log Message:
> -----------
> Add USB sys file-system support (v8) (TJ)
>
> This patch adds support for host USB devices discovered via:
>
> /sys/bus/usb/devices/* and opened from /dev/bus/usb/*/*
> /dev/bus/usb/devices and opened from /dev/bus/usb/*/*
>
> in addition to the existing discovery via:
>
> /proc/bus/usb/devices and opened from /proc/bus/usb/*/*
And it introduces a few more warnings to the non-debug build... Possible
fix below.
Signed-off-by: Jan Kiszka <address@hidden>
---
usb-linux.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: b/usb-linux.c
===================================================================
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -76,6 +76,8 @@ static int usb_host_find_device(int *pbu
#define dprintf(...)
#endif
+#define USBDBG_DEVOPENED "husb: opened %s/devices\n"
+
#define USBPROCBUS_PATH "/proc/bus/usb"
#define PRODUCT_NAME_SZ 32
#define MAX_ENDPOINTS 16
@@ -1262,8 +1264,6 @@ static int usb_host_scan(void *opaque, U
FILE *f = 0;
DIR *dir = 0;
int ret = 0;
- const char *devices = "/devices";
- const char *opened = "husb: opened %s%s\n";
const char *fs_type[] = {"unknown", "proc", "dev", "sys"};
char devpath[PATH_MAX];
@@ -1275,7 +1275,7 @@ static int usb_host_scan(void *opaque, U
strcpy(devpath, USBPROCBUS_PATH);
usb_fs_type = USB_FS_PROC;
fclose(f);
- dprintf(opened, USBPROCBUS_PATH, devices);
+ dprintf(USBDBG_DEVOPENED, USBPROCBUS_PATH);
goto found_devices;
}
/* try additional methods if an access method hasn't been found yet */
@@ -1285,7 +1285,7 @@ static int usb_host_scan(void *opaque, U
strcpy(devpath, USBDEVBUS_PATH);
usb_fs_type = USB_FS_DEV;
fclose(f);
- dprintf(opened, USBDEVBUS_PATH, devices);
+ dprintf(USBDBG_DEVOPENED, USBDEVBUS_PATH);
goto found_devices;
}
dir = opendir(USBSYSBUS_PATH "/devices");
@@ -1294,7 +1294,7 @@ static int usb_host_scan(void *opaque, U
strcpy(devpath, USBDEVBUS_PATH);
usb_fs_type = USB_FS_SYS;
closedir(dir);
- dprintf(opened, USBSYSBUS_PATH, devices);
+ dprintf(USBDBG_DEVOPENED, USBSYSBUS_PATH);
goto found_devices;
}
found_devices: