Commit fad2e1b06c12184a3273d52e6f6620b830c389e8

Authored by Wolfgang Denk
1 parent 6bc52ef35c

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>

Showing 1 changed file with 13 additions and 7 deletions Side-by-side Diff

... ... @@ -328,7 +328,6 @@
328 328 struct usb_descriptor_header *head;
329 329 int index, ifno, epno, curr_if_num;
330 330 int i;
331   - unsigned char *ch;
332 331  
333 332 ifno = -1;
334 333 epno = -1;
... ... @@ -386,7 +385,9 @@
386 385 head->bDescriptorType);
387 386  
388 387 {
389   - ch = (unsigned char *)head;
  388 +#ifdef USB_DEBUG
  389 + unsigned char *ch = (unsigned char *)head;
  390 +#endif
390 391 for (i = 0; i < head->bLength; i++)
391 392 USB_PRINTF("%02X ", *ch++);
392 393 USB_PRINTF("\n\n\n");
... ... @@ -1120,7 +1121,7 @@
1120 1121 {
1121 1122 struct usb_device *usb;
1122 1123 struct usb_port_status portsts;
1123   - unsigned short portstatus, portchange;
  1124 + unsigned short portstatus;
1124 1125  
1125 1126 /* Check status */
1126 1127 if (usb_get_port_status(dev, port + 1, &portsts) < 0) {
1127 1128  
... ... @@ -1129,9 +1130,10 @@
1129 1130 }
1130 1131  
1131 1132 portstatus = le16_to_cpu(portsts.wPortStatus);
1132   - portchange = le16_to_cpu(portsts.wPortChange);
1133 1133 USB_HUB_PRINTF("portstatus %x, change %x, %s\n",
1134   - portstatus, portchange, portspeed(portstatus));
  1134 + portstatus,
  1135 + le16_to_cpu(portsts.wPortChange),
  1136 + portspeed(portstatus));
1135 1137  
1136 1138 /* Clear the connection change status */
1137 1139 usb_clear_port_feature(dev, port + 1, USB_PORT_FEAT_C_CONNECTION);
1138 1140  
1139 1141  
... ... @@ -1178,11 +1180,13 @@
1178 1180  
1179 1181 int usb_hub_configure(struct usb_device *dev)
1180 1182 {
  1183 + int i;
1181 1184 unsigned char buffer[USB_BUFSIZ], *bitmap;
1182 1185 struct usb_hub_descriptor *descriptor;
1183   - struct usb_hub_status *hubsts;
1184   - int i;
1185 1186 struct usb_hub_device *hub;
  1187 +#ifdef USB_HUB_DEBUG
  1188 + struct usb_hub_status *hubsts;
  1189 +#endif
1186 1190  
1187 1191 /* "allocate" Hub device */
1188 1192 hub = usb_hub_allocate();
1189 1193  
... ... @@ -1284,7 +1288,9 @@
1284 1288 return -1;
1285 1289 }
1286 1290  
  1291 +#ifdef USB_HUB_DEBUG
1287 1292 hubsts = (struct usb_hub_status *)buffer;
  1293 +#endif
1288 1294 USB_HUB_PRINTF("get_hub_status returned status %X, change %X\n",
1289 1295 le16_to_cpu(hubsts->wHubStatus),
1290 1296 le16_to_cpu(hubsts->wHubChange));