: remove the kcallloc cast (reported from make coccicheck's drop_kmalloc_cast.cocci)
PATCH 1/1 : remove the kcallloc cast (reported from make coccicheck's drop_kmalloc_cast.cocci)
Signed-off-by Devendra Naga <[email protected]>
--- sound/pci/emu10k1/emufx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/emu10k1/emufx.c +1 -1
@@ -1815,7 +1815,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)if ((icode =kzalloc (sizeof (*icode),GFP_KERNEL )) ==NULL )return -ENOMEM ; - if ((icode->gpr_map = (u_int32_t __user *) + if ((icode->gpr_map = kcalloc(256 + 160 + 160 + 2 * 512, sizeof(u_int32_t), GFP_KERNEL)) == NULL || (controls = kcalloc(SND_EMU10K1_GPR_CONTROLS,
Signature · 1 line
1.7.9.5
At Thu, 24 May 2012 19:32:29 +0530,
Quoted 2 lines · Devendra Naga
Signed-off-by Devendra Naga <[email protected]>
I don't think removing it improves anything much. It's cast to __user pointer, and this rather helps to catch the caution.
thanks,
Takashi
Quoted 20 lines
--- sound/pci/emu10k1/emufx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)sound/pci/emu10k1/emufx.c +1
-1@@ -1815,7 +1815,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)if ((icode =kzalloc (sizeof (*icode),GFP_KERNEL )) ==NULL )return -ENOMEM ; - if ((icode->gpr_map = (u_int32_t __user *) + if ((icode->gpr_map = kcalloc(256 + 160 + 160 + 2 * 512, sizeof(u_int32_t), GFP_KERNEL)) == NULL || (controls = kcalloc(SND_EMU10K1_GPR_CONTROLS,Signature · 1 line
1.7.9.5