Staging: hv: Transform some kzalloc calls to kcalloc
Here is a short excerpt of the semantic patch performing this transformation: (http://www.emn.fr/x-info/coccinelle/) //<smpl> @@ expression E1,E2,E3; @@ - kzalloc(E1*sizeof(E2),E3) + kcalloc(E1,sizeof(E2),E3) @@ expression E1,E3; type T; @@ - kzalloc(E1*sizeof(T),E3) + kcalloc(E1,sizeof(T),E3) //</smpl> Signed-off-by: Nicolas Palix <npalix@diku.dk> Cc: Hank Janssen <hjanssen@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c18b5aed9d
commit
06da0bc865
@@ -473,7 +473,7 @@ static struct scatterlist *create_bounce_buffer(struct scatterlist *sgl, unsigne
|
|||||||
|
|
||||||
num_pages = ALIGN_UP(len, PAGE_SIZE) >> PAGE_SHIFT;
|
num_pages = ALIGN_UP(len, PAGE_SIZE) >> PAGE_SHIFT;
|
||||||
|
|
||||||
bounce_sgl = kzalloc(num_pages * sizeof(struct scatterlist), GFP_ATOMIC);
|
bounce_sgl = kcalloc(num_pages, sizeof(struct scatterlist), GFP_ATOMIC);
|
||||||
if (!bounce_sgl)
|
if (!bounce_sgl)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -928,14 +928,14 @@ static void storvsc_host_rescan_callback(struct work_struct *work)
|
|||||||
DPRINT_ENTER(STORVSC_DRV);
|
DPRINT_ENTER(STORVSC_DRV);
|
||||||
|
|
||||||
host_device_ctx = (struct host_device_context*)host->hostdata;
|
host_device_ctx = (struct host_device_context*)host->hostdata;
|
||||||
lun_list = kzalloc(sizeof(unsigned int)*STORVSC_MAX_LUNS_PER_TARGET, GFP_ATOMIC);
|
lun_list = kcalloc(STORVSC_MAX_LUNS_PER_TARGET, sizeof(unsigned int), GFP_ATOMIC);
|
||||||
if (!lun_list)
|
if (!lun_list)
|
||||||
{
|
{
|
||||||
DPRINT_ERR(STORVSC_DRV, "unable to allocate lun list");
|
DPRINT_ERR(STORVSC_DRV, "unable to allocate lun list");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sdevs_remove_list = kzalloc(sizeof(void*)*STORVSC_MAX_LUNS_PER_TARGET, GFP_ATOMIC);
|
sdevs_remove_list = kcalloc(STORVSC_MAX_LUNS_PER_TARGET, sizeof(void *), GFP_ATOMIC);
|
||||||
if (!sdevs_remove_list)
|
if (!sdevs_remove_list)
|
||||||
{
|
{
|
||||||
kfree(lun_list);
|
kfree(lun_list);
|
||||||
|
Reference in New Issue
Block a user