* [U-Boot] [PATCH] USB: fix create_pipe()
@ 2010-05-26 17:26 Sergei Shtylyov
2010-05-27 19:03 ` Remy Bohmer
0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2010-05-26 17:26 UTC (permalink / raw)
To: u-boot
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>
---
include/usb.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: u-boot/include/usb.h
===================================================================
--- u-boot.orig/include/usb.h
+++ u-boot/include/usb.h
@@ -259,7 +259,7 @@ int usb_set_interface(struct usb_device
*/
/* 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)
^ permalink raw reply [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] USB: fix create_pipe()
2010-05-26 17:26 [U-Boot] [PATCH] USB: fix create_pipe() Sergei Shtylyov
@ 2010-05-27 19:03 ` Remy Bohmer
0 siblings, 0 replies; 2+ messages in thread
From: Remy Bohmer @ 2010-05-27 19:03 UTC (permalink / raw)
To: u-boot
Hi,
2010/5/26 Sergei Shtylyov <sshtylyov@ru.mvista.com>:
> 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>
>
> ---
> ?include/usb.h | ? ?2 +-
> ?1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-usb
Thanks.
Remy
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-27 19:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-26 17:26 [U-Boot] [PATCH] USB: fix create_pipe() Sergei Shtylyov
2010-05-27 19:03 ` Remy Bohmer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.