From: Markus Elfring <Markus.Elfring@web.de>
To: Vincent Mailhol <mailhol.vincent@wanadoo.fr>, linux-can@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org, Chen Ni <nichen@iscas.ac.cn>,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: Re: can: ucan: Use usb_endpoint_type() rather than duplicating its implementation
Date: Wed, 25 Jun 2025 18:23:15 +0200 [thread overview]
Message-ID: <7e6f8929-6665-45af-b01b-167a1aa80305@web.de> (raw)
In-Reply-To: <c04376f2-6ab7-4256-8bdc-aa6ff3ea88b4@wanadoo.fr>
> A real quick search shows me that this ucan driver is not an isolated case.
> Here is an example:
>
> https://elixir.bootlin.com/linux/v6.16-rc3/source/drivers/media/rc/imon.c#L2137-L2148
Thanks that you pointed another implementation detail out from
the function “imon_find_endpoints”.
> But it does not seem to occur so often either. So not sure what is the best:
> do a manual hunt
Unlikely.
I am unsure if such an aspect would become relevant for a code review
by other contributors.
> or write a coccinelle checker.
I would find it more convenient to achieve corresponding adjustments
to some degree with the help of such a development tool.
I constructed scripts for the semantic patch language accordingly.
>> Can the functions “usb_endpoint_is_bulk_in” and “usb_endpoint_is_bulk_out”
>> be applied here?
>> https://elixir.bootlin.com/linux/v6.16-rc3/source/include/uapi/linux/usb/ch9.h#L572-L595
>
> Further simplification, nice :)
>
> I didn't see that last one, so glad you found what seems to be the optimal solution!
I am unsure if the check reordering would be desirable for this function implementation.
Regards,
Markus
next prev parent reply other threads:[~2025-06-25 16:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 17:12 [PATCH] can: ucan: Use usb_endpoint_type() rather than duplicating its implementation Markus Elfring
2025-06-24 17:29 ` Vincent Mailhol
2025-06-24 18:28 ` Markus Elfring
2025-06-24 22:59 ` Vincent Mailhol
2025-06-25 5:47 ` [PATCH] " Markus Elfring
2025-06-25 15:51 ` Vincent Mailhol
2025-06-25 16:23 ` Markus Elfring [this message]
2025-06-26 2:47 ` Vincent Mailhol
2025-06-26 7:22 ` Markus Elfring
2025-06-26 9:23 ` Vincent Mailhol
2025-06-26 14:46 ` [PATCH v2] can: ucan: Use two USB endpoint API functions rather than duplicating their implementations Markus Elfring
2025-06-26 14:50 ` Vincent Mailhol
2025-06-26 15:06 ` Marc Kleine-Budde
2025-06-26 15:17 ` [v2] " Markus Elfring
2025-06-24 19:21 ` [PATCH] can: ucan: Use usb_endpoint_type() rather than duplicating its implementation Markus Elfring
2025-06-24 23:03 ` Vincent Mailhol
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7e6f8929-6665-45af-b01b-167a1aa80305@web.de \
--to=markus.elfring@web.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mailhol.vincent@wanadoo.fr \
--cc=mkl@pengutronix.de \
--cc=nichen@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).