summaryrefslogtreecommitdiffstats
path: root/drivers/atm
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2016-09-10 04:21:15 -0400
committerDavid S. Miller <davem@davemloft.net>2016-09-11 00:46:07 -0400
commit0f0d0ed0870eca21e36dc520d7d9be292c103f80 (patch)
tree62f373ae9dd82713d4dc2e48d30693ac83e13c5d /drivers/atm
parent5ad3ea3d3952dcbb8047f97fbfa49804ea53a53a (diff)
ATM-ZeitNet: Replace one kzalloc() call by kcalloc()
* The script "checkpatch.pl" can point information out like the following. WARNING: Prefer kcalloc over kzalloc with multiply Thus fix the affected source code place. * Replace the specification of a data type by a pointer dereference to make the corresponding size determination a bit safer according to the Linux coding style convention. * Delete the local variable "size" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/atm')
-rw-r--r--drivers/atm/zatm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
index 218c6af60f21..2cc9e2a63d3e 100644
--- a/drivers/atm/zatm.c
+++ b/drivers/atm/zatm.c
@@ -598,12 +598,13 @@ static void close_rx(struct atm_vcc *vcc)
598static int start_rx(struct atm_dev *dev) 598static int start_rx(struct atm_dev *dev)
599{ 599{
600 struct zatm_dev *zatm_dev; 600 struct zatm_dev *zatm_dev;
601 int size,i; 601 int i;
602 602
603DPRINTK("start_rx\n"); 603DPRINTK("start_rx\n");
604 zatm_dev = ZATM_DEV(dev); 604 zatm_dev = ZATM_DEV(dev);
605 size = sizeof(struct atm_vcc *)*zatm_dev->chans; 605 zatm_dev->rx_map = kcalloc(zatm_dev->chans,
606 zatm_dev->rx_map = kzalloc(size,GFP_KERNEL); 606 sizeof(*zatm_dev->rx_map),
607 GFP_KERNEL);
607 if (!zatm_dev->rx_map) return -ENOMEM; 608 if (!zatm_dev->rx_map) return -ENOMEM;
608 /* set VPI/VCI split (use all VCIs and give what's left to VPIs) */ 609 /* set VPI/VCI split (use all VCIs and give what's left to VPIs) */
609 zpokel(zatm_dev,(1 << dev->ci_range.vci_bits)-1,uPD98401_VRR); 610 zpokel(zatm_dev,(1 << dev->ci_range.vci_bits)-1,uPD98401_VRR);