提交 d0fe1128 编写于 作者: S Sergei Shtylyov 提交者: Remy Bohmer

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: NSergei Shtylyov <sshtylyov@ru.mvista.com>
上级 01f03bda
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册