Re: can: ucan: Use usb_endpoint_type() rather than duplicating its implementation

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

 



>> I am unsure if the check reordering would be desirable for this function implementation.
> 
> Ah, you want to confirm whether
> 
>   usb_endpoint_dir_in(ep) && usb_endpoint_xfer_bulk(ep)
> 
> is the same as
> 
>   usb_endpoint_xfer_bulk(ep) && usb_endpoint_dir_in(ep)
> 
> ?

Exactly, yes.

Commutativity can probably be applied in this case.
But the different execution order will influence the corresponding run time characteristics.
https://en.wikipedia.org/wiki/Short-circuit_evaluation
https://en.wikipedia.org/wiki/Commutative_property

The data processing order from known API function implementations might get priority
also at discussed source code places in the near future.

Regards,
Markus





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux