Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[linux-3.10.git] / drivers / net / ethernet / oki-semi / pch_gbe / pch_gbe_main.c
index 73ce7dd..60eb890 100644 (file)
@@ -1469,13 +1469,11 @@ pch_gbe_alloc_rx_buffers_pool(struct pch_gbe_adapter *adapter,
 
        size = rx_ring->count * bufsz + PCH_GBE_RESERVE_MEMORY;
        rx_ring->rx_buff_pool = dma_alloc_coherent(&pdev->dev, size,
-                                               &rx_ring->rx_buff_pool_logic,
-                                               GFP_KERNEL);
-       if (!rx_ring->rx_buff_pool) {
-               pr_err("Unable to allocate memory for the receive pool buffer\n");
+                                                  &rx_ring->rx_buff_pool_logic,
+                                                  GFP_KERNEL | __GFP_ZERO);
+       if (!rx_ring->rx_buff_pool)
                return -ENOMEM;
-       }
-       memset(rx_ring->rx_buff_pool, 0, size);
+
        rx_ring->rx_buff_pool_size = size;
        for (i = 0; i < rx_ring->count; i++) {
                buffer_info = &rx_ring->buffer_info[i];
@@ -1774,13 +1772,12 @@ int pch_gbe_setup_tx_resources(struct pch_gbe_adapter *adapter,
        tx_ring->size = tx_ring->count * (int)sizeof(struct pch_gbe_tx_desc);
 
        tx_ring->desc = dma_alloc_coherent(&pdev->dev, tx_ring->size,
-                                          &tx_ring->dma, GFP_KERNEL);
+                                          &tx_ring->dma,
+                                          GFP_KERNEL | __GFP_ZERO);
        if (!tx_ring->desc) {
                vfree(tx_ring->buffer_info);
-               pr_err("Unable to allocate memory for the transmit descriptor ring\n");
                return -ENOMEM;
        }
-       memset(tx_ring->desc, 0, tx_ring->size);
 
        tx_ring->next_to_use = 0;
        tx_ring->next_to_clean = 0;
@@ -1820,14 +1817,12 @@ int pch_gbe_setup_rx_resources(struct pch_gbe_adapter *adapter,
 
        rx_ring->size = rx_ring->count * (int)sizeof(struct pch_gbe_rx_desc);
        rx_ring->desc = dma_alloc_coherent(&pdev->dev, rx_ring->size,
-                                          &rx_ring->dma, GFP_KERNEL);
-
+                                          &rx_ring->dma,
+                                          GFP_KERNEL | __GFP_ZERO);
        if (!rx_ring->desc) {
-               pr_err("Unable to allocate memory for the receive descriptor ring\n");
                vfree(rx_ring->buffer_info);
                return -ENOMEM;
        }
-       memset(rx_ring->desc, 0, rx_ring->size);
        rx_ring->next_to_clean = 0;
        rx_ring->next_to_use = 0;
        for (desNo = 0; desNo < rx_ring->count; desNo++) {