Skip to content

Commit 392a07a

Browse files
author
Sarah Sharp
committed
xhci: Fix conditional check in bandwidth calculation.
David reports that at drivers/usb/host/xhci.c:2257: static bool xhci_is_sync_in_ep(unsigned int ep_type) { return (ep_type == ISOC_IN_EP || ep_type != INT_IN_EP); } The static analyser cppcheck says [linux-3.7-rc2/drivers/usb/host/xhci.c:2257]: (style) Redundant condition: If ep_type == 5, the comparison ep_type != 7 is always true. Maybe the original programmer intention was something like static bool xhci_is_sync_in_ep(unsigned int ep_type) { return (ep_type == ISOC_IN_EP || ep_type == INT_IN_EP); } Fix this. This patch should be backported to stable kernels as old as 3.2, that contain the commit 2b69899 "xhci: USB 3.0 BW checking." Signed-off-by: Sarah Sharp <[email protected]> Reported-by: David Binderman <[email protected]> Cc: [email protected]
1 parent 2611bd1 commit 392a07a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/host/xhci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2255,7 +2255,7 @@ static bool xhci_is_async_ep(unsigned int ep_type)
22552255

22562256
static bool xhci_is_sync_in_ep(unsigned int ep_type)
22572257
{
2258-
return (ep_type == ISOC_IN_EP || ep_type != INT_IN_EP);
2258+
return (ep_type == ISOC_IN_EP || ep_type == INT_IN_EP);
22592259
}
22602260

22612261
static unsigned int xhci_get_ss_bw_consumed(struct xhci_bw_info *ep_bw)

0 commit comments

Comments
 (0)