* [PATCH] [emu10k1]: remove the kcallloc cast (reported from make coccicheck's drop_kmalloc_cast.cocci)
@ 2012-05-24 14:02 Devendra Naga
2012-05-25 6:04 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Devendra Naga @ 2012-05-24 14:02 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel; +Cc: Devendra Naga
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
---
sound/pci/emu10k1/emufx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index dae4050..272f8ac 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -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,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] [emu10k1]: remove the kcallloc cast (reported from make coccicheck's drop_kmalloc_cast.cocci)
2012-05-24 14:02 [PATCH] [emu10k1]: remove the kcallloc cast (reported from make coccicheck's drop_kmalloc_cast.cocci) Devendra Naga
@ 2012-05-25 6:04 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2012-05-25 6:04 UTC (permalink / raw)
To: Devendra Naga; +Cc: Jaroslav Kysela, alsa-devel, linux-kernel
At Thu, 24 May 2012 19:32:29 +0530,
Devendra Naga wrote:
>
> Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
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
> ---
> sound/pci/emu10k1/emufx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
> index dae4050..272f8ac 100644
> --- a/sound/pci/emu10k1/emufx.c
> +++ b/sound/pci/emu10k1/emufx.c
> @@ -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,
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-25 6:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-24 14:02 [PATCH] [emu10k1]: remove the kcallloc cast (reported from make coccicheck's drop_kmalloc_cast.cocci) Devendra Naga
2012-05-25 6:04 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox