diff mbox

[-next] qlcnic: convert list_for_each to entry variant

Message ID CAPgLHd_dxz-Nh2MAtEnSBWBrpSoyUBsQaoc2Hvh7CH4hhfNQKA@mail.gmail.com
State Deferred, archived
Delegated to: David Miller
Headers show

Commit Message

Wei Yongjun May 13, 2013, 9:01 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

convert list_for_each() to list_for_each_entry().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 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

Comments

Shahed Shaikh May 13, 2013, 3:57 p.m. UTC | #1
> -----Original Message-----
> From: Wei Yongjun [mailto:weiyj.lk@gmail.com]
> Sent: Monday, May 13, 2013 2:31 PM
> To: Rajesh Borundia; Shahed Shaikh; Jitendra Kalsaria; Sony Chacko
> Cc: yongjun_wei@trendmicro.com.cn; Dept-Eng Linux Driver; netdev
> Subject: [PATCH -next] qlcnic: convert list_for_each to entry variant
> 
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> convert list_for_each() to list_for_each_entry().
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> index 8fb836d..d7d4851 100644
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> @@ -311,10 +311,8 @@ int qlcnic_read_mac_addr(struct qlcnic_adapter
> *adapter)  static void qlcnic_delete_adapter_mac(struct qlcnic_adapter
> *adapter)  {
>  	struct qlcnic_mac_list_s *cur;
> -	struct list_head *head;
> 
> -	list_for_each(head, &adapter->mac_list) {
> -		cur = list_entry(head, struct qlcnic_mac_list_s, list);
> +	list_for_each_entry(cur, &adapter->mac_list, list) {
>  		if (!memcmp(adapter->mac_addr, cur->mac_addr,
> ETH_ALEN)) {
>  			qlcnic_sre_macaddr_change(adapter, cur-
> >mac_addr,
>  						  0, QLCNIC_MAC_DEL);
> 

Thanks!

Acked-by: Shahed Shaikh <shahed.shaikh@qlogic.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
diff mbox

Patch

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 8fb836d..d7d4851 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -311,10 +311,8 @@  int qlcnic_read_mac_addr(struct qlcnic_adapter *adapter)
 static void qlcnic_delete_adapter_mac(struct qlcnic_adapter *adapter)
 {
 	struct qlcnic_mac_list_s *cur;
-	struct list_head *head;
 
-	list_for_each(head, &adapter->mac_list) {
-		cur = list_entry(head, struct qlcnic_mac_list_s, list);
+	list_for_each_entry(cur, &adapter->mac_list, list) {
 		if (!memcmp(adapter->mac_addr, cur->mac_addr, ETH_ALEN)) {
 			qlcnic_sre_macaddr_change(adapter, cur->mac_addr,
 						  0, QLCNIC_MAC_DEL);