[ATM]: kmalloc to kzalloc patches for drivers/atm
[deliverable/linux.git] / drivers / atm / zatm.c
index 55959e4d1cb77d3aef5269340fff23241f873d58..c491ec455cac405bef84dace1d05fcd31e0ecb89 100644 (file)
@@ -3,7 +3,6 @@
 /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -604,9 +603,8 @@ static int start_rx(struct atm_dev *dev)
 DPRINTK("start_rx\n");
        zatm_dev = ZATM_DEV(dev);
        size = sizeof(struct atm_vcc *)*zatm_dev->chans;
-       zatm_dev->rx_map = (struct atm_vcc **) kmalloc(size,GFP_KERNEL);
+       zatm_dev->rx_map =  kzalloc(size,GFP_KERNEL);
        if (!zatm_dev->rx_map) return -ENOMEM;
-       memset(zatm_dev->rx_map,0,size);
        /* set VPI/VCI split (use all VCIs and give what's left to VPIs) */
        zpokel(zatm_dev,(1 << dev->ci_range.vci_bits)-1,uPD98401_VRR);
        /* prepare free buffer pools */
@@ -669,11 +667,13 @@ printk("NONONONOO!!!!\n");
                u32 *put;
                int i;
 
-               dsc = (u32 *) kmalloc(uPD98401_TXPD_SIZE*2+
-                   uPD98401_TXBD_SIZE*ATM_SKB(skb)->iovcnt,GFP_ATOMIC);
+               dsc = kmalloc(uPD98401_TXPD_SIZE * 2 +
+                       uPD98401_TXBD_SIZE * ATM_SKB(skb)->iovcnt, GFP_ATOMIC);
                if (!dsc) {
-                       if (vcc->pop) vcc->pop(vcc,skb);
-                       else dev_kfree_skb_irq(skb);
+                       if (vcc->pop)
+                               vcc->pop(vcc, skb);
+                       else
+                               dev_kfree_skb_irq(skb);
                        return -EAGAIN;
                }
                /* @@@ should check alignment */
@@ -683,7 +683,7 @@ printk("NONONONOO!!!!\n");
                    (ATM_SKB(skb)->atm_options & ATM_ATMOPT_CLP ?
                    uPD98401_CLPM_1 : uPD98401_CLPM_0));
                dsc[1] = 0;
-               dsc[2] = ATM_SKB(skb)->iovcnt*uPD98401_TXBD_SIZE;
+               dsc[2] = ATM_SKB(skb)->iovcnt * uPD98401_TXBD_SIZE;
                dsc[3] = virt_to_bus(put);
                for (i = 0; i < ATM_SKB(skb)->iovcnt; i++) {
                        *put++ = ((struct iovec *) skb->data)[i].iov_len;
@@ -950,9 +950,8 @@ static int open_tx_first(struct atm_vcc *vcc)
        skb_queue_head_init(&zatm_vcc->tx_queue);
        init_waitqueue_head(&zatm_vcc->tx_wait);
        /* initialize ring */
-       zatm_vcc->ring = kmalloc(RING_SIZE,GFP_KERNEL);
+       zatm_vcc->ring = kzalloc(RING_SIZE,GFP_KERNEL);
        if (!zatm_vcc->ring) return -ENOMEM;
-       memset(zatm_vcc->ring,0,RING_SIZE);
        loop = zatm_vcc->ring+RING_ENTRIES*RING_WORDS;
        loop[0] = uPD98401_TXPD_V;
        loop[1] = loop[2] = 0;
@@ -1269,7 +1268,7 @@ static int __init zatm_start(struct atm_dev *dev)
        zatm_dev->rx_map = zatm_dev->tx_map = NULL;
        for (i = 0; i < NR_MBX; i++)
                zatm_dev->mbx_start[i] = 0;
-       error = request_irq(zatm_dev->irq, zatm_int, SA_SHIRQ, DEV_LABEL, dev);
+       error = request_irq(zatm_dev->irq, zatm_int, IRQF_SHARED, DEV_LABEL, dev);
        if (error < 0) {
                printk(KERN_ERR DEV_LABEL "(itf %d): IRQ%d is already in use\n",
                    dev->number,zatm_dev->irq);
This page took 0.025638 seconds and 5 git commands to generate.