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>
This commit is contained in:
parent
01f03bda5b
commit
d0fe1128c4
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user