diff options
author | Bart Van Assche <bart.vanassche@wdc.com> | 2017-08-17 13:13:18 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-08-18 08:45:29 -0600 |
commit | 01433d0de0ee8fd6258cd193d6359a3a20c67172 (patch) | |
tree | ad62d47442f599081e0065540cba40bb8ba443dc /drivers | |
parent | 85e34112cf5564dddbc26f4b9f79ee1f5941f551 (diff) | |
download | linux-stable-01433d0de0ee8fd6258cd193d6359a3a20c67172.tar.gz linux-stable-01433d0de0ee8fd6258cd193d6359a3a20c67172.tar.bz2 linux-stable-01433d0de0ee8fd6258cd193d6359a3a20c67172.zip |
skd: Use kcalloc() instead of kzalloc() with multiply
This patch does not change any functionality.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/skd_main.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c index 0639c9f89984..ae66171ef10a 100644 --- a/drivers/block/skd_main.c +++ b/drivers/block/skd_main.c @@ -3815,12 +3815,13 @@ static int skd_cons_skmsg(struct skd_device *skdev) u32 i; dev_dbg(&skdev->pdev->dev, - "skmsg_table kzalloc, struct %lu, count %u total %lu\n", + "skmsg_table kcalloc, struct %lu, count %u total %lu\n", sizeof(struct skd_fitmsg_context), skdev->num_fitmsg_context, sizeof(struct skd_fitmsg_context) * skdev->num_fitmsg_context); - skdev->skmsg_table = kzalloc(sizeof(struct skd_fitmsg_context) - *skdev->num_fitmsg_context, GFP_KERNEL); + skdev->skmsg_table = kcalloc(skdev->num_fitmsg_context, + sizeof(struct skd_fitmsg_context), + GFP_KERNEL); if (skdev->skmsg_table == NULL) { rc = -ENOMEM; goto err_out; @@ -3895,12 +3896,13 @@ static int skd_cons_skreq(struct skd_device *skdev) u32 i; dev_dbg(&skdev->pdev->dev, - "skreq_table kzalloc, struct %lu, count %u total %lu\n", + "skreq_table kcalloc, struct %lu, count %u total %lu\n", sizeof(struct skd_request_context), skdev->num_req_context, sizeof(struct skd_request_context) * skdev->num_req_context); - skdev->skreq_table = kzalloc(sizeof(struct skd_request_context) - * skdev->num_req_context, GFP_KERNEL); + skdev->skreq_table = kcalloc(skdev->num_req_context, + sizeof(struct skd_request_context), + GFP_KERNEL); if (skdev->skreq_table == NULL) { rc = -ENOMEM; goto err_out; @@ -3918,8 +3920,8 @@ static int skd_cons_skreq(struct skd_device *skdev) skreq->id = i + SKD_ID_RW_REQUEST; skreq->state = SKD_REQ_STATE_IDLE; - skreq->sg = kzalloc(sizeof(struct scatterlist) * - skdev->sgs_per_request, GFP_KERNEL); + skreq->sg = kcalloc(skdev->sgs_per_request, + sizeof(struct scatterlist), GFP_KERNEL); if (skreq->sg == NULL) { rc = -ENOMEM; goto err_out; @@ -3952,12 +3954,13 @@ static int skd_cons_skspcl(struct skd_device *skdev) u32 i, nbytes; dev_dbg(&skdev->pdev->dev, - "skspcl_table kzalloc, struct %lu, count %u total %lu\n", + "skspcl_table kcalloc, struct %lu, count %u total %lu\n", sizeof(struct skd_special_context), skdev->n_special, sizeof(struct skd_special_context) * skdev->n_special); - skdev->skspcl_table = kzalloc(sizeof(struct skd_special_context) - * skdev->n_special, GFP_KERNEL); + skdev->skspcl_table = kcalloc(skdev->n_special, + sizeof(struct skd_special_context), + GFP_KERNEL); if (skdev->skspcl_table == NULL) { rc = -ENOMEM; goto err_out; @@ -3983,8 +3986,9 @@ static int skd_cons_skspcl(struct skd_device *skdev) goto err_out; } - skspcl->req.sg = kzalloc(sizeof(struct scatterlist) * - SKD_N_SG_PER_SPECIAL, GFP_KERNEL); + skspcl->req.sg = kcalloc(SKD_N_SG_PER_SPECIAL, + sizeof(struct scatterlist), + GFP_KERNEL); if (skspcl->req.sg == NULL) { rc = -ENOMEM; goto err_out; |