]> git.baikalelectronics.ru Git - kernel.git/commit
xhci: Fix conditional check in bandwidth calculation.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Thu, 25 Oct 2012 20:44:12 +0000 (13:44 -0700)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Mon, 12 Nov 2012 19:45:26 +0000 (11:45 -0800)
commit192a247be0f20fe41cdeb762b0943cd3e74ea833
tree630fa9c82ac60ce6f51bf0fedeaa40c3d0abd6b0
parentfa2922f619ed1a9cf71d77e0f8390b9c53765c40
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 d3f2142a4a4397f4fb1f5bfa0190d7b44718c2bf "xhci: USB
3.0 BW checking."

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: David Binderman <dcb314@hotmail.com>
Cc: stable@vger.kernel.org
drivers/usb/host/xhci.c