Re: usb/host/xhci.c:2257: possible coding error in logical expression ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 24, 2012 at 08:55:09PM +0000, David Binderman wrote:
> 
> 
> Hello there,
> 
> The source code is from the subject line is
> 
> 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);
> }
> 
> Suggest code rework.

Thanks for catching that!  I think your analysis is correct, but since
the fix impacts the Panther Point xHCI bandwidth calculations, I need to
do some testing with SuperSpeed interrupt IN endpoints (probably on USB3
hubs) before I submit a patch.

Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux