Skip to content
Snippets Groups Projects
Commit d0fe1128 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Remy Bohmer
Browse files

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: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
parent 01f03bda
No related branches found
No related tags found
No related merge requests found
...@@ -259,7 +259,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate); ...@@ -259,7 +259,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
*/ */
/* Create various pipes... */ /* Create various pipes... */
#define create_pipe(dev,endpoint) \ #define create_pipe(dev,endpoint) \
(((dev)->devnum << 8) | (endpoint << 15) | \ (((dev)->devnum << 8) | ((endpoint) << 15) | \
((dev)->speed << 26) | (dev)->maxpacketsize) ((dev)->speed << 26) | (dev)->maxpacketsize)
#define default_pipe(dev) ((dev)->speed << 26) #define default_pipe(dev) ((dev)->speed << 26)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment