diff options
author | Eli Billauer | 2014-09-04 16:47:40 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2014-09-08 22:58:18 +0200 |
commit | 5899005f94b66a1ec3f06d299bb2625098cc9720 (patch) | |
tree | 62c09947f4a9b0fbd72f6f7595b4ca1984c960eb /drivers/staging/xillybus | |
parent | staging: comedi: adl_pci9118: move analog input (*insn_read) function (diff) | |
download | kernel-qcow2-linux-5899005f94b66a1ec3f06d299bb2625098cc9720.tar.gz kernel-qcow2-linux-5899005f94b66a1ec3f06d299bb2625098cc9720.tar.xz kernel-qcow2-linux-5899005f94b66a1ec3f06d299bb2625098cc9720.zip |
staging: xillybus: Use devm_kcalloc() for arrays
Replace devm_kzalloc where it applies.
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/xillybus')
-rw-r--r-- | drivers/staging/xillybus/xillybus_core.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/staging/xillybus/xillybus_core.c b/drivers/staging/xillybus/xillybus_core.c index d5a7202b0ac7..cacd560dd6d9 100644 --- a/drivers/staging/xillybus/xillybus_core.c +++ b/drivers/staging/xillybus/xillybus_core.c @@ -329,9 +329,9 @@ static int xilly_get_dma_buffers(struct xilly_endpoint *ep, struct xilly_buffer *this_buffer = NULL; /* Init to silence warning */ if (buffers) { /* Not the message buffer */ - this_buffer = devm_kzalloc( - dev, bufnum * sizeof(struct xilly_buffer), - GFP_KERNEL); + this_buffer = devm_kcalloc(dev, bufnum, + sizeof(struct xilly_buffer), + GFP_KERNEL); if (!this_buffer) return -ENOMEM; @@ -434,13 +434,13 @@ static int xilly_setupchannels(struct xilly_endpoint *ep, .regdirection = 0x80000000, }; - channel = devm_kzalloc(dev, ep->num_channels * + channel = devm_kcalloc(dev, ep->num_channels, sizeof(struct xilly_channel), GFP_KERNEL); if (!channel) goto memfail; - ep->channels = devm_kzalloc(dev, (ep->num_channels + 1) * + ep->channels = devm_kcalloc(dev, ep->num_channels + 1, sizeof(struct xilly_channel *), GFP_KERNEL); @@ -517,9 +517,9 @@ static int xilly_setupchannels(struct xilly_endpoint *ep, bytebufsize = channel->rd_buf_size = bufsize * (1 << channel->log2_element_size); - buffers = devm_kzalloc(dev, - bufnum * sizeof(struct xilly_buffer *), - GFP_KERNEL); + buffers = devm_kcalloc(dev, bufnum, + sizeof(struct xilly_buffer *), + GFP_KERNEL); if (!buffers) goto memfail; |