From: Markus Elfring <Markus.Elfring@web.de>
To: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Claudiu Beznea <claudiu.beznea@tuxon.dev>,
Cristian Birsan <cristian.birsan@microchip.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org, Chen Ni <nichen@iscas.ac.cn>
Subject: [PATCH] usb: gadget: udc: atmel: Use usb_endpoint_num() rather than duplicating its implementation
Date: Tue, 24 Jun 2025 15:21:36 +0200 [thread overview]
Message-ID: <f4981e10-a56a-4197-827f-13d43d0c03c8@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 24 Jun 2025 15:08:46 +0200
Subject: [PATCH] usb: gadget: udc: atmel: Use usb_endpoint_num() rather than duplicating its implementation
Reuse existing functionality from usb_endpoint_num() instead of keeping
duplicate source code.
The source code was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/usb/gadget/udc/atmel_usba_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index 0c6f2ad81d37..35d0909ab812 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -580,7 +580,7 @@ usba_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
maxpacket = usb_endpoint_maxp(desc);
- if (((desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK) != ep->index)
+ if (usb_endpoint_num(desc) != ep->index
|| ep->index == 0
|| desc->bDescriptorType != USB_DT_ENDPOINT
|| maxpacket == 0
--
2.50.0
reply other threads:[~2025-06-24 13:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=f4981e10-a56a-4197-827f-13d43d0c03c8@web.de \
--to=markus.elfring@web.de \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=cristian.birsan@microchip.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=nichen@iscas.ac.cn \
--cc=nicolas.ferre@microchip.com \
/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