diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-10-06 23:41:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-10-07 14:52:14 -0400 |
commit | 9545f4e2beb1b4faae5b57250f18b0047fa191fc (patch) | |
tree | 81a5d9446d7fb8e1385e445c0ee57789d4e6653a /drivers/net | |
parent | d717f14ee0ffb53cb59bd069a33ea36d03a5406e (diff) |
ptp: use list_move instead of list_del/list_add
Using list_move() instead of list_del() + list_add().
dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/sfc/ptp.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c index 5b3dd028ce85..0767043f44a4 100644 --- a/drivers/net/ethernet/sfc/ptp.c +++ b/drivers/net/ethernet/sfc/ptp.c | |||
@@ -640,8 +640,7 @@ static void efx_ptp_drop_time_expired_events(struct efx_nic *efx) | |||
640 | evt = list_entry(cursor, struct efx_ptp_event_rx, | 640 | evt = list_entry(cursor, struct efx_ptp_event_rx, |
641 | link); | 641 | link); |
642 | if (time_after(jiffies, evt->expiry)) { | 642 | if (time_after(jiffies, evt->expiry)) { |
643 | list_del(&evt->link); | 643 | list_move(&evt->link, &ptp->evt_free_list); |
644 | list_add(&evt->link, &ptp->evt_free_list); | ||
645 | netif_warn(efx, hw, efx->net_dev, | 644 | netif_warn(efx, hw, efx->net_dev, |
646 | "PTP rx event dropped\n"); | 645 | "PTP rx event dropped\n"); |
647 | } | 646 | } |
@@ -684,8 +683,7 @@ static enum ptp_packet_state efx_ptp_match_rx(struct efx_nic *efx, | |||
684 | 683 | ||
685 | match->state = PTP_PACKET_STATE_MATCHED; | 684 | match->state = PTP_PACKET_STATE_MATCHED; |
686 | rc = PTP_PACKET_STATE_MATCHED; | 685 | rc = PTP_PACKET_STATE_MATCHED; |
687 | list_del(&evt->link); | 686 | list_move(&evt->link, &ptp->evt_free_list); |
688 | list_add(&evt->link, &ptp->evt_free_list); | ||
689 | break; | 687 | break; |
690 | } | 688 | } |
691 | } | 689 | } |
@@ -820,8 +818,7 @@ static int efx_ptp_stop(struct efx_nic *efx) | |||
820 | /* Drop any pending receive events */ | 818 | /* Drop any pending receive events */ |
821 | spin_lock_bh(&efx->ptp_data->evt_lock); | 819 | spin_lock_bh(&efx->ptp_data->evt_lock); |
822 | list_for_each_safe(cursor, next, &efx->ptp_data->evt_list) { | 820 | list_for_each_safe(cursor, next, &efx->ptp_data->evt_list) { |
823 | list_del(cursor); | 821 | list_move(cursor, &efx->ptp_data->evt_free_list); |
824 | list_add(cursor, &efx->ptp_data->evt_free_list); | ||
825 | } | 822 | } |
826 | spin_unlock_bh(&efx->ptp_data->evt_lock); | 823 | spin_unlock_bh(&efx->ptp_data->evt_lock); |
827 | 824 | ||