All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] RDMA/irdma: Use list_move instead of list_del/list_add
@ 2021-06-08  3:10 Baokun Li
  2021-06-08  9:18 ` Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Baokun Li @ 2021-06-08  3:10 UTC (permalink / raw)
  To: linux-kernel, Mustafa Ismail, Shiraz Saleem, Doug Ledford,
	Jason Gunthorpe
  Cc: weiyongjun1, yuehaibing, yangjihong1, yukuai3, libaokun1,
	linux-rdma, kernel-janitors, Hulk Robot

Using list_move() instead of list_del() + list_add().

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
 drivers/infiniband/hw/irdma/puda.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/irdma/puda.c b/drivers/infiniband/hw/irdma/puda.c
index 18057139817d..c0be6e37d425 100644
--- a/drivers/infiniband/hw/irdma/puda.c
+++ b/drivers/infiniband/hw/irdma/puda.c
@@ -1420,8 +1420,7 @@ irdma_ieq_handle_partial(struct irdma_puda_rsrc *ieq, struct irdma_pfpdu *pfpdu,
 error:
 	while (!list_empty(&pbufl)) {
 		buf = (struct irdma_puda_buf *)(pbufl.prev);
-		list_del(&buf->list);
-		list_add(&buf->list, rxlist);
+		list_move(&buf->list, rxlist);
 	}
 	if (txbuf)
 		irdma_puda_ret_bufpool(ieq, txbuf);


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

* Re: [PATCH -next] RDMA/irdma: Use list_move instead of list_del/list_add
  2021-06-08  3:10 [PATCH -next] RDMA/irdma: Use list_move instead of list_del/list_add Baokun Li
@ 2021-06-08  9:18 ` Dan Carpenter
  2021-06-08 16:25 ` Saleem, Shiraz
  2021-06-08 20:01 ` Jason Gunthorpe
  2 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-06-08  9:18 UTC (permalink / raw)
  To: Baokun Li
  Cc: linux-kernel, Mustafa Ismail, Shiraz Saleem, Doug Ledford,
	Jason Gunthorpe, weiyongjun1, yuehaibing, yangjihong1, yukuai3,
	linux-rdma, kernel-janitors, Hulk Robot

On Tue, Jun 08, 2021 at 11:10:41AM +0800, Baokun Li wrote:
> Using list_move() instead of list_del() + list_add().
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---
>  drivers/infiniband/hw/irdma/puda.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/irdma/puda.c b/drivers/infiniband/hw/irdma/puda.c
> index 18057139817d..c0be6e37d425 100644
> --- a/drivers/infiniband/hw/irdma/puda.c
> +++ b/drivers/infiniband/hw/irdma/puda.c
> @@ -1420,8 +1420,7 @@ irdma_ieq_handle_partial(struct irdma_puda_rsrc *ieq, struct irdma_pfpdu *pfpdu,
>  error:
>  	while (!list_empty(&pbufl)) {
>  		buf = (struct irdma_puda_buf *)(pbufl.prev);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Not related to your patch but this would be nicer as:

		buf = list_last_entry(&pbufl, struct irdma_puda_buf, list);

> -		list_del(&buf->list);
> -		list_add(&buf->list, rxlist);
> +		list_move(&buf->list, rxlist);

regards,
dan carpenter

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

* RE: [PATCH -next] RDMA/irdma: Use list_move instead of list_del/list_add
  2021-06-08  3:10 [PATCH -next] RDMA/irdma: Use list_move instead of list_del/list_add Baokun Li
  2021-06-08  9:18 ` Dan Carpenter
@ 2021-06-08 16:25 ` Saleem, Shiraz
  2021-06-08 20:01 ` Jason Gunthorpe
  2 siblings, 0 replies; 4+ messages in thread
From: Saleem, Shiraz @ 2021-06-08 16:25 UTC (permalink / raw)
  To: Baokun Li, linux-kernel, Ismail, Mustafa, Doug Ledford, Jason Gunthorpe
  Cc: weiyongjun1, yuehaibing, yangjihong1, yukuai3, linux-rdma,
	kernel-janitors, Hulk Robot

> Subject: [PATCH -next] RDMA/irdma: Use list_move instead of list_del/list_add
> 
> Using list_move() instead of list_del() + list_add().
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---

Acked-by: Shiraz Saleem <shiraz.saleem@intel.com>

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

* Re: [PATCH -next] RDMA/irdma: Use list_move instead of list_del/list_add
  2021-06-08  3:10 [PATCH -next] RDMA/irdma: Use list_move instead of list_del/list_add Baokun Li
  2021-06-08  9:18 ` Dan Carpenter
  2021-06-08 16:25 ` Saleem, Shiraz
@ 2021-06-08 20:01 ` Jason Gunthorpe
  2 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2021-06-08 20:01 UTC (permalink / raw)
  To: Baokun Li
  Cc: linux-kernel, Mustafa Ismail, Shiraz Saleem, Doug Ledford,
	weiyongjun1, yuehaibing, yangjihong1, yukuai3, linux-rdma,
	kernel-janitors, Hulk Robot

On Tue, Jun 08, 2021 at 11:10:41AM +0800, Baokun Li wrote:
> Using list_move() instead of list_del() + list_add().
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> Acked-by: Shiraz Saleem <shiraz.saleem@intel.com>
> ---
>  drivers/infiniband/hw/irdma/puda.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied to for-next, thanks

Jason

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

end of thread, other threads:[~2021-06-08 20:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-08  3:10 [PATCH -next] RDMA/irdma: Use list_move instead of list_del/list_add Baokun Li
2021-06-08  9:18 ` Dan Carpenter
2021-06-08 16:25 ` Saleem, Shiraz
2021-06-08 20:01 ` Jason Gunthorpe

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.