drivers:net: dma_alloc_coherent: use __GFP_ZERO instead of memset(, 0)
[deliverable/linux.git] / drivers / net / ethernet / xilinx / xilinx_axienet_main.c
index c238f980e28e8b9a2ab53219dae5bafb13965262..24748e8367a1ad346a245bc890eb27bc8b659b0a 100644 (file)
@@ -204,25 +204,23 @@ static int axienet_dma_bd_init(struct net_device *ndev)
        lp->tx_bd_v = dma_alloc_coherent(ndev->dev.parent,
                                         sizeof(*lp->tx_bd_v) * TX_BD_NUM,
                                         &lp->tx_bd_p,
-                                        GFP_KERNEL);
+                                        GFP_KERNEL | __GFP_ZERO);
        if (!lp->tx_bd_v)
                goto out;
 
        lp->rx_bd_v = dma_alloc_coherent(ndev->dev.parent,
                                         sizeof(*lp->rx_bd_v) * RX_BD_NUM,
                                         &lp->rx_bd_p,
-                                        GFP_KERNEL);
+                                        GFP_KERNEL | __GFP_ZERO);
        if (!lp->rx_bd_v)
                goto out;
 
-       memset(lp->tx_bd_v, 0, sizeof(*lp->tx_bd_v) * TX_BD_NUM);
        for (i = 0; i < TX_BD_NUM; i++) {
                lp->tx_bd_v[i].next = lp->tx_bd_p +
                                      sizeof(*lp->tx_bd_v) *
                                      ((i + 1) % TX_BD_NUM);
        }
 
-       memset(lp->rx_bd_v, 0, sizeof(*lp->rx_bd_v) * RX_BD_NUM);
        for (i = 0; i < RX_BD_NUM; i++) {
                lp->rx_bd_v[i].next = lp->rx_bd_p +
                                      sizeof(*lp->rx_bd_v) *
This page took 0.024773 seconds and 5 git commands to generate.