Commit 6bf93ba8 authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller

e1000: Replace e1000_free_frag with skb_free_frag

Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@redhat.com>
Acked-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 13dc0d2b
...@@ -2079,11 +2079,6 @@ static void *e1000_alloc_frag(const struct e1000_adapter *a) ...@@ -2079,11 +2079,6 @@ static void *e1000_alloc_frag(const struct e1000_adapter *a)
return data; return data;
} }
static void e1000_free_frag(const void *data)
{
put_page(virt_to_head_page(data));
}
/** /**
* e1000_clean_rx_ring - Free Rx Buffers per Queue * e1000_clean_rx_ring - Free Rx Buffers per Queue
* @adapter: board private structure * @adapter: board private structure
...@@ -2107,7 +2102,7 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter, ...@@ -2107,7 +2102,7 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter,
adapter->rx_buffer_len, adapter->rx_buffer_len,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
if (buffer_info->rxbuf.data) { if (buffer_info->rxbuf.data) {
e1000_free_frag(buffer_info->rxbuf.data); skb_free_frag(buffer_info->rxbuf.data);
buffer_info->rxbuf.data = NULL; buffer_info->rxbuf.data = NULL;
} }
} else if (adapter->clean_rx == e1000_clean_jumbo_rx_irq) { } else if (adapter->clean_rx == e1000_clean_jumbo_rx_irq) {
...@@ -4594,28 +4589,28 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter, ...@@ -4594,28 +4589,28 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
data = e1000_alloc_frag(adapter); data = e1000_alloc_frag(adapter);
/* Failed allocation, critical failure */ /* Failed allocation, critical failure */
if (!data) { if (!data) {
e1000_free_frag(olddata); skb_free_frag(olddata);
adapter->alloc_rx_buff_failed++; adapter->alloc_rx_buff_failed++;
break; break;
} }
if (!e1000_check_64k_bound(adapter, data, bufsz)) { if (!e1000_check_64k_bound(adapter, data, bufsz)) {
/* give up */ /* give up */
e1000_free_frag(data); skb_free_frag(data);
e1000_free_frag(olddata); skb_free_frag(olddata);
adapter->alloc_rx_buff_failed++; adapter->alloc_rx_buff_failed++;
break; break;
} }
/* Use new allocation */ /* Use new allocation */
e1000_free_frag(olddata); skb_free_frag(olddata);
} }
buffer_info->dma = dma_map_single(&pdev->dev, buffer_info->dma = dma_map_single(&pdev->dev,
data, data,
adapter->rx_buffer_len, adapter->rx_buffer_len,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
if (dma_mapping_error(&pdev->dev, buffer_info->dma)) { if (dma_mapping_error(&pdev->dev, buffer_info->dma)) {
e1000_free_frag(data); skb_free_frag(data);
buffer_info->dma = 0; buffer_info->dma = 0;
adapter->alloc_rx_buff_failed++; adapter->alloc_rx_buff_failed++;
break; break;
...@@ -4637,7 +4632,7 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter, ...@@ -4637,7 +4632,7 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
adapter->rx_buffer_len, adapter->rx_buffer_len,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
e1000_free_frag(data); skb_free_frag(data);
buffer_info->rxbuf.data = NULL; buffer_info->rxbuf.data = NULL;
buffer_info->dma = 0; buffer_info->dma = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment