Thread (1 message) 1 message, 1 author, 2012-07-09

Re: [PATCH v9 REBASE 6/9] USB: notify phy when root hub port connect change

From: Greg KH <hidden>
Date: 2012-07-09 16:57:57
Also in: linux-arm-kernel

On Sat, Jul 07, 2012 at 10:56:45PM +0800, Richard Zhao wrote:
quoted hunk
Phy may need to change settings when port connect change.

Signed-off-by: Richard Zhao <redacted>
Tested-by: Subodh Nijsure <snijsure-4jo+YWezP1RWk0Htik3J/w@public.gmane.org>
---
 drivers/usb/core/hub.c |    8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 4cc8dc9..2ba9d84 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -20,6 +20,7 @@
 #include <linux/usb.h>
 #include <linux/usbdevice_fs.h>
 #include <linux/usb/hcd.h>
+#include <linux/usb/otg.h>
 #include <linux/usb/quirks.h>
 #include <linux/kthread.h>
 #include <linux/mutex.h>
@@ -4037,6 +4038,13 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
 		}
 	}
 
+	if (unlikely(hcd->phy && !hdev->parent)) {
Why is this "unlikely"?  And why mark it as such, is this a "fast path"
that needs the compiler to know this hint to optimize things here?

Please don't use likely() or unlikely() except in places it really is
needed, _and_ you have measured the difference.  Have you done so in
this place?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help