drivers:net: Convert dma_alloc_coherent(...__GFP_ZERO) to dma_zalloc_coherent
[deliverable/linux.git] / drivers / net / ethernet / pasemi / pasemi_mac.c
index a5f0b5da614933c74ebbf005edba139b4bb74b88..c498181a9aa823e18e9e120821254c3721bbdad3 100644 (file)
@@ -191,7 +191,7 @@ static int pasemi_get_mac_addr(struct pasemi_mac *mac)
        struct device_node *dn = pci_device_to_OF_node(pdev);
        int len;
        const u8 *maddr;
-       u8 addr[6];
+       u8 addr[ETH_ALEN];
 
        if (!dn) {
                dev_dbg(&pdev->dev,
@@ -201,8 +201,8 @@ static int pasemi_get_mac_addr(struct pasemi_mac *mac)
 
        maddr = of_get_property(dn, "local-mac-address", &len);
 
-       if (maddr && len == 6) {
-               memcpy(mac->mac_addr, maddr, 6);
+       if (maddr && len == ETH_ALEN) {
+               memcpy(mac->mac_addr, maddr, ETH_ALEN);
                return 0;
        }
 
@@ -219,14 +219,15 @@ static int pasemi_get_mac_addr(struct pasemi_mac *mac)
                return -ENOENT;
        }
 
-       if (sscanf(maddr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &addr[0],
-                  &addr[1], &addr[2], &addr[3], &addr[4], &addr[5]) != 6) {
+       if (sscanf(maddr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
+                  &addr[0], &addr[1], &addr[2], &addr[3], &addr[4], &addr[5])
+           != ETH_ALEN) {
                dev_warn(&pdev->dev,
                         "can't parse mac address, not configuring\n");
                return -EINVAL;
        }
 
-       memcpy(mac->mac_addr, addr, 6);
+       memcpy(mac->mac_addr, addr, ETH_ALEN);
 
        return 0;
 }
@@ -439,10 +440,9 @@ static int pasemi_mac_setup_rx_resources(const struct net_device *dev)
        if (pasemi_dma_alloc_ring(&ring->chan, RX_RING_SIZE))
                goto out_ring_desc;
 
-       ring->buffers = dma_alloc_coherent(&mac->dma_pdev->dev,
-                                          RX_RING_SIZE * sizeof(u64),
-                                          &ring->buf_dma,
-                                          GFP_KERNEL | __GFP_ZERO);
+       ring->buffers = dma_zalloc_coherent(&mac->dma_pdev->dev,
+                                           RX_RING_SIZE * sizeof(u64),
+                                           &ring->buf_dma, GFP_KERNEL);
        if (!ring->buffers)
                goto out_ring_desc;
 
This page took 0.025572 seconds and 5 git commands to generate.