Patchwork [-next] bnx2x: use list_move instead of list_del/list_add

login
register
mail settings
Submitter Wei Yongjun
Date March 11, 2013, 2:40 p.m.
Message ID <CAPgLHd8f_Vq40sB9SaD-3wsHp34ifQ7X+uoMUNDfjFHcy4wJkQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/226568/
State Accepted
Delegated to: David Miller
Headers show

Comments

Wei Yongjun - March 11, 2013, 2:40 p.m.
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ariel Elior - March 11, 2013, 4:53 p.m.
On Monday, March 11, 2013 4:40 PM Wei Yongjun wrote:
> Using list_move() instead of list_del() + list_add().
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> index 71fcef0..c32a066 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> @@ -556,8 +556,7 @@ static int bnx2x_vfop_config_list(struct bnx2x *bp,
>  		rc = bnx2x_config_vlan_mac(bp, vlan_mac);
>  		if (rc >= 0) {
>  			cnt += pos->add ? 1 : -1;
> -			list_del(&pos->link);
> -			list_add(&pos->link, &rollback_list);
> +			list_move(&pos->link, &rollback_list);
>  			rc = 0;
>  		} else if (rc == -EEXIST) {
>  			rc = 0;
> 
> --

Thanks

Acked-by: Ariel Elior <ariele@broadcom.com>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - March 12, 2013, 12:15 p.m.
From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Mon, 11 Mar 2013 22:40:14 +0800

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Using list_move() instead of list_del() + list_add().
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 71fcef0..c32a066 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -556,8 +556,7 @@  static int bnx2x_vfop_config_list(struct bnx2x *bp,
 		rc = bnx2x_config_vlan_mac(bp, vlan_mac);
 		if (rc >= 0) {
 			cnt += pos->add ? 1 : -1;
-			list_del(&pos->link);
-			list_add(&pos->link, &rollback_list);
+			list_move(&pos->link, &rollback_list);
 			rc = 0;
 		} else if (rc == -EEXIST) {
 			rc = 0;