summaryrefslogtreecommitdiff
path: root/include/usb.h
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2010-05-26 21:26:43 +0400
committerRemy Bohmer <linux@bohmer.net>2010-05-27 20:59:48 +0200
commitd0fe1128c4451327b9cb0fac1a76efd194b078b5 (patch)
treed582cdd84bf9fcb4887074b1cd04d02a11a52a97 /include/usb.h
parent01f03bda5b22e5aeae5f02fd537da97a41485c73 (diff)
downloadu-boot-d0fe1128c4451327b9cb0fac1a76efd194b078b5.tar.gz
u-boot-d0fe1128c4451327b9cb0fac1a76efd194b078b5.tar.bz2
u-boot-d0fe1128c4451327b9cb0fac1a76efd194b078b5.zip
USB: fix create_pipe()
create_pipe() can give wrong result if an expression is passed as the 'endpoint' argument -- due to missing parentheses. Thanks to Martin Mueller for finding the bug and providing the patch. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Diffstat (limited to 'include/usb.h')
-rw-r--r--include/usb.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/usb.h b/include/usb.h
index a1f09d4d7a..bc4ccfe150 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -259,7 +259,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
*/
/* Create various pipes... */
#define create_pipe(dev,endpoint) \
- (((dev)->devnum << 8) | (endpoint << 15) | \
+ (((dev)->devnum << 8) | ((endpoint) << 15) | \
((dev)->speed << 26) | (dev)->maxpacketsize)
#define default_pipe(dev) ((dev)->speed << 26)