diff options
author | Wolfgang Denk <wd@denx.de> | 2011-10-05 23:11:19 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-10-09 23:24:50 +0200 |
commit | fad2e1b06c12184a3273d52e6f6620b830c389e8 (patch) | |
tree | 053185c4fcf7c741f5078514102ae281c6390c63 /common/usb.c | |
parent | 6bc52ef35c0eee8a6b74f01bbea0471ad39421a1 (diff) | |
download | u-boot-imx-fad2e1b06c12184a3273d52e6f6620b830c389e8.zip u-boot-imx-fad2e1b06c12184a3273d52e6f6620b830c389e8.tar.gz u-boot-imx-fad2e1b06c12184a3273d52e6f6620b830c389e8.tar.bz2 |
common/usb.c: fix warning: variable ... set but not used
Fix:
usb.c: In function 'usb_parse_config':
usb.c:331:17: warning: variable 'ch' set but not used [-Wunused-but-set-variable]
usb.c: In function 'usb_hub_port_connect_change':
usb.c:1123:29: warning: variable 'portchange' set but not used [-Wunused-but-set-variable]
usb.c: In function 'usb_hub_configure':
usb.c:1183:25: warning: variable 'hubsts' set but not used [-Wunused-but-set-variable]
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Remy Bohmer <linux@bohmer.net>
Acked-by: Remy Bohmer <linux@bohmer.net>
Diffstat (limited to 'common/usb.c')
-rw-r--r-- | common/usb.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/common/usb.c b/common/usb.c index a401c09..2cd50db 100644 --- a/common/usb.c +++ b/common/usb.c @@ -328,7 +328,6 @@ int usb_parse_config(struct usb_device *dev, unsigned char *buffer, int cfgno) struct usb_descriptor_header *head; int index, ifno, epno, curr_if_num; int i; - unsigned char *ch; ifno = -1; epno = -1; @@ -386,7 +385,9 @@ int usb_parse_config(struct usb_device *dev, unsigned char *buffer, int cfgno) head->bDescriptorType); { - ch = (unsigned char *)head; +#ifdef USB_DEBUG + unsigned char *ch = (unsigned char *)head; +#endif for (i = 0; i < head->bLength; i++) USB_PRINTF("%02X ", *ch++); USB_PRINTF("\n\n\n"); @@ -1120,7 +1121,7 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port) { struct usb_device *usb; struct usb_port_status portsts; - unsigned short portstatus, portchange; + unsigned short portstatus; /* Check status */ if (usb_get_port_status(dev, port + 1, &portsts) < 0) { @@ -1129,9 +1130,10 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port) } portstatus = le16_to_cpu(portsts.wPortStatus); - portchange = le16_to_cpu(portsts.wPortChange); USB_HUB_PRINTF("portstatus %x, change %x, %s\n", - portstatus, portchange, portspeed(portstatus)); + portstatus, + le16_to_cpu(portsts.wPortChange), + portspeed(portstatus)); /* Clear the connection change status */ usb_clear_port_feature(dev, port + 1, USB_PORT_FEAT_C_CONNECTION); @@ -1178,11 +1180,13 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port) int usb_hub_configure(struct usb_device *dev) { + int i; unsigned char buffer[USB_BUFSIZ], *bitmap; struct usb_hub_descriptor *descriptor; - struct usb_hub_status *hubsts; - int i; struct usb_hub_device *hub; +#ifdef USB_HUB_DEBUG + struct usb_hub_status *hubsts; +#endif /* "allocate" Hub device */ hub = usb_hub_allocate(); @@ -1284,7 +1288,9 @@ int usb_hub_configure(struct usb_device *dev) return -1; } +#ifdef USB_HUB_DEBUG hubsts = (struct usb_hub_status *)buffer; +#endif USB_HUB_PRINTF("get_hub_status returned status %X, change %X\n", le16_to_cpu(hubsts->wHubStatus), le16_to_cpu(hubsts->wHubChange)); |