linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: emu10k1: casting (void *) value returned by kcalloc is useless
@ 2013-09-05  5:57 Duan Jiong
  2013-09-05  6:12 ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Duan Jiong @ 2013-09-05  5:57 UTC (permalink / raw)
  To: perex; +Cc: linux-kernel

From: Duan Jiong <duanj.fnst@cn.fujitsu.com>

Casting (void *) value returned by kcalloc is useless
as mentioned in Documentation/CodingStyle, Chap 14.

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
 sound/pci/emu10k1/emufx.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index 0275209..68edb2d 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -1183,9 +1183,8 @@ static int _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu)
 	mm_segment_t seg;
 
 	if ((icode = kzalloc(sizeof(*icode), GFP_KERNEL)) == NULL ||
-	    (icode->gpr_map = (u_int32_t __user *)
-	     kcalloc(512 + 256 + 256 + 2 * 1024, sizeof(u_int32_t),
-		     GFP_KERNEL)) == NULL ||
+	    (icode->gpr_map = kcalloc(512 + 256 + 256 + 2 * 1024,
+				sizeof(u_int32_t), GFP_KERNEL)) == NULL ||
 	    (controls = kcalloc(SND_EMU10K1_GPR_CONTROLS,
 				sizeof(*controls), GFP_KERNEL)) == NULL) {
 		err = -ENOMEM;
@@ -1815,9 +1814,8 @@ static int _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 *)
-	     kcalloc(256 + 160 + 160 + 2 * 512, sizeof(u_int32_t),
-		     GFP_KERNEL)) == NULL ||
+	if ((icode->gpr_map = kcalloc(256 + 160 + 160 + 2 * 512,
+				sizeof(u_int32_t), GFP_KERNEL)) == NULL ||
             (controls = kcalloc(SND_EMU10K1_GPR_CONTROLS,
 				sizeof(struct snd_emu10k1_fx8010_control_gpr),
 				GFP_KERNEL)) == NULL ||
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-05 10:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-05  5:57 [PATCH] ALSA: emu10k1: casting (void *) value returned by kcalloc is useless Duan Jiong
2013-09-05  6:12 ` Joe Perches
2013-09-05 10:10   ` Duan Jiong
2013-09-05 10:18     ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).