[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1e64bcef-33f1-4295-b91f-d4598b32b866@web.de>
Date: Thu, 26 Jun 2025 09:22:17 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Vincent Mailhol <mailhol.vincent@...adoo.fr>, linux-can@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
Chen Ni <nichen@...as.ac.cn>, Marc Kleine-Budde <mkl@...gutronix.de>
Subject: Re: can: ucan: Use usb_endpoint_type() rather than duplicating its
implementation
>> 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
Powered by blists - more mailing lists