From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] USB: fix create_pipe()
Date: Wed, 26 May 2010 21:26:43 +0400 [thread overview]
Message-ID: <201005262126.43781.sshtylyov@ru.mvista.com> (raw)
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)
next reply other threads:[~2010-05-26 17:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-26 17:26 Sergei Shtylyov [this message]
2010-05-27 19:03 ` [U-Boot] [PATCH] USB: fix create_pipe() Remy Bohmer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201005262126.43781.sshtylyov@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox