linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: udc-xilinx: remove unnecessary initialization of list iterator
@ 2022-03-16  7:51 Xiaomeng Tong
  2022-04-22 12:59 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Xiaomeng Tong @ 2022-03-16  7:51 UTC (permalink / raw)
  To: balbi
  Cc: gregkh, michal.simek, linux-usb, linux-arm-kernel, linux-kernel,
	Xiaomeng Tong

'req' will always be set by the subsequent list_for_each_entry()
before any uses. Thus, to avoid ambiguity it is better to remove
the unnecessary initialization of list iterator 'req'.

Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
---
 drivers/usb/gadget/udc/udc-xilinx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c
index 6ce886fb7..fa6cbfc63 100644
--- a/drivers/usb/gadget/udc/udc-xilinx.c
+++ b/drivers/usb/gadget/udc/udc-xilinx.c
@@ -1136,7 +1136,7 @@ static int xudc_ep_queue(struct usb_ep *_ep, struct usb_request *_req,
 static int xudc_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
 {
 	struct xusb_ep *ep	= to_xusb_ep(_ep);
-	struct xusb_req *req	= to_xusb_req(_req);
+	struct xusb_req *req;
 	struct xusb_udc *udc	= ep->udc;
 	unsigned long flags;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: gadget: udc-xilinx: remove unnecessary initialization of list iterator
  2022-03-16  7:51 [PATCH] usb: gadget: udc-xilinx: remove unnecessary initialization of list iterator Xiaomeng Tong
@ 2022-04-22 12:59 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2022-04-22 12:59 UTC (permalink / raw)
  To: Xiaomeng Tong
  Cc: balbi, michal.simek, linux-usb, linux-arm-kernel, linux-kernel

On Wed, Mar 16, 2022 at 03:51:53PM +0800, Xiaomeng Tong wrote:
> 'req' will always be set by the subsequent list_for_each_entry()
> before any uses. Thus, to avoid ambiguity it is better to remove
> the unnecessary initialization of list iterator 'req'.
> 
> Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
> ---
>  drivers/usb/gadget/udc/udc-xilinx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c
> index 6ce886fb7..fa6cbfc63 100644
> --- a/drivers/usb/gadget/udc/udc-xilinx.c
> +++ b/drivers/usb/gadget/udc/udc-xilinx.c
> @@ -1136,7 +1136,7 @@ static int xudc_ep_queue(struct usb_ep *_ep, struct usb_request *_req,
>  static int xudc_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
>  {
>  	struct xusb_ep *ep	= to_xusb_ep(_ep);
> -	struct xusb_req *req	= to_xusb_req(_req);
> +	struct xusb_req *req;
>  	struct xusb_udc *udc	= ep->udc;
>  	unsigned long flags;
>  
> -- 
> 2.17.1
> 

Does not apply anymore :(

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-22 13:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-16  7:51 [PATCH] usb: gadget: udc-xilinx: remove unnecessary initialization of list iterator Xiaomeng Tong
2022-04-22 12:59 ` Greg KH

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).