diff mbox series

[-next,v2] usb: cdns3: cdns3-gadget: Use list_move_tail instead of list_del/list_add_tail

Message ID 20210609072720.1358527-1-libaokun1@huawei.com
State New
Headers show
Series [-next,v2] usb: cdns3: cdns3-gadget: Use list_move_tail instead of list_del/list_add_tail | expand

Commit Message

libaokun (A) June 9, 2021, 7:27 a.m. UTC
Using list_move_tail() instead of list_del() + list_add_tail().

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
V1->V2:
	CC mailist

 drivers/usb/cdns3/cdns3-gadget.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Peter Chen June 10, 2021, 2:17 p.m. UTC | #1
On 21-06-09 15:27:20, Baokun Li wrote:
> Using list_move_tail() instead of list_del() + list_add_tail().

> 

> Reported-by: Hulk Robot <hulkci@huawei.com>

> Signed-off-by: Baokun Li <libaokun1@huawei.com>

> ---

> V1->V2:

> 	CC mailist

> 

>  drivers/usb/cdns3/cdns3-gadget.c | 4 +---

>  1 file changed, 1 insertion(+), 3 deletions(-)

> 

> diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c

> index 57adcdbfab5f..5d8c982019af 100644

> --- a/drivers/usb/cdns3/cdns3-gadget.c

> +++ b/drivers/usb/cdns3/cdns3-gadget.c

> @@ -430,9 +430,7 @@ static int cdns3_start_all_request(struct cdns3_device *priv_dev,

>  		if (ret)

>  			return ret;

>  

> -		list_del(&request->list);

> -		list_add_tail(&request->list,

> -			      &priv_ep->pending_req_list);

> +		list_move_tail(&request->list, &priv_ep->pending_req_list);

>  		if (request->stream_id != 0 || (priv_ep->flags & EP_TDLCHK_EN))

>  			break;

>  	}

> 


Applied, thanks.

-- 

Thanks,
Peter Chen
diff mbox series

Patch

diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
index 57adcdbfab5f..5d8c982019af 100644
--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -430,9 +430,7 @@  static int cdns3_start_all_request(struct cdns3_device *priv_dev,
 		if (ret)
 			return ret;
 
-		list_del(&request->list);
-		list_add_tail(&request->list,
-			      &priv_ep->pending_req_list);
+		list_move_tail(&request->list, &priv_ep->pending_req_list);
 		if (request->stream_id != 0 || (priv_ep->flags & EP_TDLCHK_EN))
 			break;
 	}