usb: remove unneeded NULL check in usb_disconnect()
Subsystems (2)
PATCH 1/1 usb: remove unneeded NULL check in usb_disconnect()
We dereference "udev" and then immediately check whether it's NULL which makes the static checkers complain. "udev" isn't NULL here so the check can be removed.
Signed-off-by Dan Carpenter <[email protected]>
---
Alan Stern says it can never be NULL and I double checked as well. usb_disconnect() is only called from hub.c and hcd.c.
drivers/usb/core/hub.c +0 -5
@@ -1636,11 +1636,6 @@ void usb_disconnect(struct usb_device **pdev)int i;struct usb_hcd *hcd =bus_to_hcd (udev->bus); -if (!udev) { -pr_debug ("%s nodev\n" , __func__); -return ; - } -/* mark the device as inactive, so any further urb submissions for * this device (and any of its children) will fail immediately. * this quiesces everything except pending urbs.