Skip to content

Commit

Permalink
USB: fix unsafe USB_SS_MAX_STREAMS() definition
Browse files Browse the repository at this point in the history
Macro arguments used in expressions need to be enclosed in parenthesis
to avoid unpleasant surprises.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Dmitry Torokhov authored and Greg Kroah-Hartman committed Feb 25, 2011
1 parent 969e303 commit c964237
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/usb/ch9.h
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ struct usb_ss_ep_comp_descriptor {

#define USB_DT_SS_EP_COMP_SIZE 6
/* Bits 4:0 of bmAttributes if this is a bulk endpoint */
#define USB_SS_MAX_STREAMS(p) (1 << (p & 0x1f))
#define USB_SS_MAX_STREAMS(p) (1 << ((p) & 0x1f))

/*-------------------------------------------------------------------------*/

Expand Down

0 comments on commit c964237

Please sign in to comment.