提交 0f0d0ed0 编写于 作者: M Markus Elfring 提交者: David S. Miller

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: NMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5ad3ea3d
...@@ -598,12 +598,13 @@ static void close_rx(struct atm_vcc *vcc) ...@@ -598,12 +598,13 @@ static void close_rx(struct atm_vcc *vcc)
static int start_rx(struct atm_dev *dev) static int start_rx(struct atm_dev *dev)
{ {
struct zatm_dev *zatm_dev; struct zatm_dev *zatm_dev;
int size,i; int i;
DPRINTK("start_rx\n"); DPRINTK("start_rx\n");
zatm_dev = ZATM_DEV(dev); zatm_dev = ZATM_DEV(dev);
size = sizeof(struct atm_vcc *)*zatm_dev->chans; zatm_dev->rx_map = kcalloc(zatm_dev->chans,
zatm_dev->rx_map = kzalloc(size,GFP_KERNEL); sizeof(*zatm_dev->rx_map),
GFP_KERNEL);
if (!zatm_dev->rx_map) return -ENOMEM; if (!zatm_dev->rx_map) return -ENOMEM;
/* set VPI/VCI split (use all VCIs and give what's left to VPIs) */ /* 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); zpokel(zatm_dev,(1 << dev->ci_range.vci_bits)-1,uPD98401_VRR);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册