]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/net/wan/dscc4.c
some kmalloc/memset ->kzalloc (tree wide)
[mirror_ubuntu-artful-kernel.git] / drivers / net / wan / dscc4.c
index af4d4155905bfc70e2aa9c72d84befcb9d624069..50d2f9108dca364806befcf9c1a068bf7609f4ef 100644 (file)
@@ -365,7 +365,7 @@ static int dscc4_init_ring(struct net_device *);
 static void dscc4_release_ring(struct dscc4_dev_priv *);
 static void dscc4_timer(unsigned long);
 static void dscc4_tx_timeout(struct net_device *);
-static irqreturn_t dscc4_irq(int irq, void *dev_id, struct pt_regs *ptregs);
+static irqreturn_t dscc4_irq(int irq, void *dev_id);
 static int dscc4_hdlc_attach(struct net_device *, unsigned short, unsigned short);
 static int dscc4_set_iface(struct dscc4_dev_priv *, struct net_device *);
 #ifdef DSCC4_POLLING
@@ -890,12 +890,11 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr)
        struct dscc4_dev_priv *root;
        int i, ret = -ENOMEM;
 
-       root = kmalloc(dev_per_card*sizeof(*root), GFP_KERNEL);
+       root = kcalloc(dev_per_card, sizeof(*root), GFP_KERNEL);
        if (!root) {
                printk(KERN_ERR "%s: can't allocate data\n", DRV_NAME);
                goto err_out;
        }
-       memset(root, 0, dev_per_card*sizeof(*root));
 
        for (i = 0; i < dev_per_card; i++) {
                root[i].dev = alloc_hdlcdev(root + i);
@@ -903,12 +902,11 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr)
                        goto err_free_dev;
        }
 
-       ppriv = kmalloc(sizeof(*ppriv), GFP_KERNEL);
+       ppriv = kzalloc(sizeof(*ppriv), GFP_KERNEL);
        if (!ppriv) {
                printk(KERN_ERR "%s: can't allocate private data\n", DRV_NAME);
                goto err_free_dev;
        }
-       memset(ppriv, 0, sizeof(struct dscc4_pci_priv));
 
        ppriv->root = root;
        spin_lock_init(&ppriv->lock);
@@ -1476,7 +1474,7 @@ static int dscc4_set_iface(struct dscc4_dev_priv *dpriv, struct net_device *dev)
        return ret;
 }
 
-static irqreturn_t dscc4_irq(int irq, void *token, struct pt_regs *ptregs)
+static irqreturn_t dscc4_irq(int irq, void *token)
 {
        struct dscc4_dev_priv *root = token;
        struct dscc4_pci_priv *priv;
@@ -1904,7 +1902,8 @@ static struct sk_buff *dscc4_init_dummy_skb(struct dscc4_dev_priv *dpriv)
                struct TxFD *tx_fd = dpriv->tx_fd + last;
 
                skb->len = DUMMY_SKB_SIZE;
-               memcpy(skb->data, version, strlen(version)%DUMMY_SKB_SIZE);
+               skb_copy_to_linear_data(skb, version,
+                                       strlen(version) % DUMMY_SKB_SIZE);
                tx_fd->state = FrameEnd | TO_STATE_TX(DUMMY_SKB_SIZE);
                tx_fd->data = pci_map_single(dpriv->pci_priv->pdev, skb->data,
                                             DUMMY_SKB_SIZE, PCI_DMA_TODEVICE);