Skip to contentSkip to conversation

usbcore: fix compile error with CONFIG_USB_SUSPEND=n

PATCH In review Alan Stern 2 participants 2 messages Feb 1, 2006 1 message not in the archive USB

lore
Share & tools
lore

Alan Stern

author
#1 lore raw

PATCH 1/1 usbcore: fix compile error with CONFIG_USB_SUSPEND=n

In reply to a message not in the archive

This patch (as647) fixes a small error introduced by a recent change to the USB core suspend/resume code.

---

Quoted 10 lines · Andrew Morton
Quoted 7 lines · Andrew Morton

drivers/usb/core/hub.c: In function `usb_resume_device':
drivers/usb/core/hub.c:1879: warning: `status' might be used uninitialized in this function

And yes, with CONFIG_USB_SUSPEND=n it is indeed buggy.

Can we please tighten things up a bit over there?

This bug is still present in Greg's tree.

This should fix it.

Alan Stern

drivers/usb/core/hub.c +1 -1
Index: usb-2.6/drivers/usb/core/hub.c
===================================================================
@@ -1890,8 +1890,8 @@ int usb_resume_device(struct usb_device 
 			status = hub_port_resume(hdev_to_hub(udev->parent),
 					udev->portnum, udev);
 		} else
-			status = 0;
 #endif
+			status = 0;
 	} else
 		status = finish_device_resume(udev);
 	if (status < 0)
#2 lore raw
Quoted 1 line · Alan Stern

This should fix it.

Well, a warning which in this case actually does indicate an error ... but yes, this looks right. Thanks.

- Dave

Quoted 15 lines

Index: usb-2.6/drivers/usb/core/hub.c
===================================================================

drivers/usb/core/hub.c +1 -1
@@ -1890,8 +1890,8 @@ int usb_resume_device(struct usb_device 
 			status = hub_port_resume(hdev_to_hub(udev->parent),
 					udev->portnum, udev);
 		} else
-			status = 0;
 #endif
+			status = 0;
 	} else
 		status = finish_device_resume(udev);
 	if (status < 0)