From f60a8b3d1968d3e2d5259e2c2d4e9f16e19a738b Mon Sep 17 00:00:00 2001 From: Fabian Frederick Date: Wed, 10 Jun 2015 18:33:26 +0200 Subject: vxge: use swap() in vxge_hw_channel_dtr_alloc() Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick Signed-off-by: David S. Miller --- drivers/net/ethernet/neterion/vxge/vxge-traffic.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'drivers/net/ethernet') diff --git a/drivers/net/ethernet/neterion/vxge/vxge-traffic.c b/drivers/net/ethernet/neterion/vxge/vxge-traffic.c index 9e1aaa7f36bb..5f630a24e491 100644 --- a/drivers/net/ethernet/neterion/vxge/vxge-traffic.c +++ b/drivers/net/ethernet/neterion/vxge/vxge-traffic.c @@ -1004,8 +1004,6 @@ void vxge_hw_device_clear_tx_rx(struct __vxge_hw_device *hldev) static enum vxge_hw_status vxge_hw_channel_dtr_alloc(struct __vxge_hw_channel *channel, void **dtrh) { - void **tmp_arr; - if (channel->reserve_ptr - channel->reserve_top > 0) { _alloc_after_swap: *dtrh = channel->reserve_arr[--channel->reserve_ptr]; @@ -1020,10 +1018,7 @@ _alloc_after_swap: * i.e. no additional lock need to be done when we free a resource */ if (channel->length - channel->free_ptr > 0) { - - tmp_arr = channel->reserve_arr; - channel->reserve_arr = channel->free_arr; - channel->free_arr = tmp_arr; + swap(channel->reserve_arr, channel->free_arr); channel->reserve_ptr = channel->length; channel->reserve_top = channel->free_ptr; channel->free_ptr = channel->length; -- cgit v1.2.3