* [PATCH v3] can: ucan: Use two USB endpoint API functions rather than duplicating their implementations
@ 2025-06-28 7:19 Markus Elfring
2025-06-29 7:19 ` Vincent Mailhol
0 siblings, 1 reply; 6+ messages in thread
From: Markus Elfring @ 2025-06-28 7:19 UTC (permalink / raw)
To: linux-can, Marc Kleine-Budde, Vincent Mailhol
Cc: LKML, kernel-janitors, Chen Ni
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 28 Jun 2025 08:56:51 +0200
* Reuse existing functionality from usb_endpoint_is_bulk_in()
and usb_endpoint_is_bulk_out() instead of keeping duplicate source code.
* Omit two comment lines which became redundant with this refactoring.
The source code was transformed by using the Coccinelle software.
Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Markus Elfring <Markus.Elfring@web.de>
---
V3:
https://lore.kernel.org/linux-can/20250626-opalescent-tireless-locust-564d48-mkl@pengutronix.de/
* Use an other email address for the tag “Signed-off-by”.
* Provide the patch version not as a direct reply to a development discussion.
V2:
Further change possibilities were taken better into account for
the USB endpoint API with the help of Vincent Mailhol.
drivers/net/can/usb/ucan.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/net/can/usb/ucan.c b/drivers/net/can/usb/ucan.c
index 07406daf7c88..0935a9b540d6 100644
--- a/drivers/net/can/usb/ucan.c
+++ b/drivers/net/can/usb/ucan.c
@@ -1351,19 +1351,11 @@ static int ucan_probe(struct usb_interface *intf,
out_ep_size = 0;
for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) {
ep = &iface_desc->endpoint[i].desc;
-
- if (((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != 0) &&
- ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
- USB_ENDPOINT_XFER_BULK)) {
- /* In Endpoint */
+ if (usb_endpoint_is_bulk_in(ep)) {
in_ep_addr = ep->bEndpointAddress;
in_ep_addr &= USB_ENDPOINT_NUMBER_MASK;
in_ep_size = le16_to_cpu(ep->wMaxPacketSize);
- } else if (((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) ==
- 0) &&
- ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
- USB_ENDPOINT_XFER_BULK)) {
- /* Out Endpoint */
+ } else if (usb_endpoint_is_bulk_out(ep)) {
out_ep_addr = ep->bEndpointAddress;
out_ep_addr &= USB_ENDPOINT_NUMBER_MASK;
out_ep_size = le16_to_cpu(ep->wMaxPacketSize);
--
2.50.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v3] can: ucan: Use two USB endpoint API functions rather than duplicating their implementations
2025-06-28 7:19 [PATCH v3] can: ucan: Use two USB endpoint API functions rather than duplicating their implementations Markus Elfring
@ 2025-06-29 7:19 ` Vincent Mailhol
2025-06-29 7:51 ` [v3] " Markus Elfring
0 siblings, 1 reply; 6+ messages in thread
From: Vincent Mailhol @ 2025-06-29 7:19 UTC (permalink / raw)
To: Markus Elfring
Cc: LKML, kernel-janitors, Chen Ni, linux-can, Marc Kleine-Budde
On 28/06/2025 at 16:19, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 28 Jun 2025 08:56:51 +0200
Your patch doesn't pass the ./script/checkpath.pl script :(
WARNING: From:/Signed-off-by: email address mismatch: 'From: Markus Elfring
<elfring@users.sourceforge.net>' != 'Signed-off-by: Markus Elfring
<Markus.Elfring@web.de>'
total: 0 errors, 1 warnings, 0 checks, 21 lines checked
Please use the same email address:
- To send the patch
- For the patch author
- For the Signed-off-by tag
> * Reuse existing functionality from usb_endpoint_is_bulk_in()
> and usb_endpoint_is_bulk_out() instead of keeping duplicate source code.
>
> * Omit two comment lines which became redundant with this refactoring.
>
> The source code was transformed by using the Coccinelle software.
>
> Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
> Signed-off-by: Markus Elfring <Markus.Elfring@web.de>
Yours sincerely,
Vincent Mailhol
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [v3] can: ucan: Use two USB endpoint API functions rather than duplicating their implementations
2025-06-29 7:19 ` Vincent Mailhol
@ 2025-06-29 7:51 ` Markus Elfring
2025-06-29 8:33 ` Vincent Mailhol
0 siblings, 1 reply; 6+ messages in thread
From: Markus Elfring @ 2025-06-29 7:51 UTC (permalink / raw)
To: Vincent Mailhol, Marc Kleine-Budde, linux-can
Cc: LKML, kernel-janitors, Chen Ni
> Please use the same email address:
You may omit the header specification “From:” (if you would find other presented
information acceptable), don't you?
What does hinder you to support additional email addresses better?
Regards,
Markus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [v3] can: ucan: Use two USB endpoint API functions rather than duplicating their implementations
2025-06-29 7:51 ` [v3] " Markus Elfring
@ 2025-06-29 8:33 ` Vincent Mailhol
2025-06-29 10:34 ` Markus Elfring
2025-06-29 11:38 ` Markus Elfring
0 siblings, 2 replies; 6+ messages in thread
From: Vincent Mailhol @ 2025-06-29 8:33 UTC (permalink / raw)
To: Markus Elfring
Cc: LKML, kernel-janitors, Chen Ni, Marc Kleine-Budde, linux-can
On 29/06/2025 at 16:51, Markus Elfring wrote:
>> Please use the same email address:
>
> You may omit the header specification “From:” (if you would find other presented
> information acceptable), don't you?
You are sending a patch which has some checkpatch warnings and you think it is
our duty to fix your mistakes? This is not how it works.
> What does hinder you to support additional email addresses better?
It is your behaviour and your unwillingness to follow the guidance from the
maintainers which hinders me. Use whatever e-mail address you want, but if you
fancy mixing different e-mail addresses, then just stop posting.
I do not want to waste any more time arguing with you.
Nacked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
(no need to reply to this thread, I will not read your post anymore).
Yours sincerely,
Vincent Mailhol
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [v3] can: ucan: Use two USB endpoint API functions rather than duplicating their implementations
2025-06-29 8:33 ` Vincent Mailhol
@ 2025-06-29 10:34 ` Markus Elfring
2025-06-29 11:38 ` Markus Elfring
1 sibling, 0 replies; 6+ messages in thread
From: Markus Elfring @ 2025-06-29 10:34 UTC (permalink / raw)
To: Vincent Mailhol, linux-can
Cc: LKML, kernel-janitors, Chen Ni, Marc Kleine-Budde
>>> Please use the same email address:
>>
>> You may omit the header specification “From:” (if you would find other presented
>> information acceptable), don't you?
>
> You are sending a patch which has some checkpatch warnings
A special warning was mentioned.
> and you think it is
> our duty to fix your mistakes?
It depends …
There can different views occur according to such communication aspects.
> This is not how it works.
See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.16-rc3#n513
https://git-scm.com/docs/git-format-patch/2.48.0#Documentation/git-format-patch.txt---from
Regards,
Markus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [v3] can: ucan: Use two USB endpoint API functions rather than duplicating their implementations
2025-06-29 8:33 ` Vincent Mailhol
2025-06-29 10:34 ` Markus Elfring
@ 2025-06-29 11:38 ` Markus Elfring
1 sibling, 0 replies; 6+ messages in thread
From: Markus Elfring @ 2025-06-29 11:38 UTC (permalink / raw)
To: Vincent Mailhol, linux-can
Cc: LKML, kernel-janitors, Chen Ni, Marc Kleine-Budde
> … Use whatever e-mail address you want, but if you
> fancy mixing different e-mail addresses, then just stop posting.
See also:
Markus_Elfring@Sonne:…/Projekte/Linux/next-analyses> git log --oneline --author=elfring@users.sourceforge.net | wc -l
1263
Regards,
Markus
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-06-29 11:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-28 7:19 [PATCH v3] can: ucan: Use two USB endpoint API functions rather than duplicating their implementations Markus Elfring
2025-06-29 7:19 ` Vincent Mailhol
2025-06-29 7:51 ` [v3] " Markus Elfring
2025-06-29 8:33 ` Vincent Mailhol
2025-06-29 10:34 ` Markus Elfring
2025-06-29 11:38 ` Markus Elfring
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.