Skip to contentSkip to conversation

Clean up unnecessary void* pointer cast.

PATCH In review Firo Yang 2 participants 2 messages Apr 22, 2015

Subsystems (2)
lore
Share & tools
lore

Firo Yang

author
#0 lore raw

PATCH 1/16 Clean up unnecessary void* pointer cast.

---
 sound/pci/emu10k1/emufx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
sound/pci/emu10k1/emufx.c +4 -4
index 56fc47b..8a39a6f 100644
@@ -1186,8 +1186,8 @@ static int _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu)
 	if (!icode)
 		return err;
 
-	icode->gpr_map = (u_int32_t __user *) kcalloc(512 + 256 + 256 + 2 * 1024,
-						      sizeof(u_int32_t), GFP_KERNEL);
+	icode->gpr_map = kcalloc(512 + 256 + 256 + 2 * 1024,
+				sizeof(u_int32_t), GFP_KERNEL);
 	if (!icode->gpr_map)
 		goto __err_gpr;
 	controls = kcalloc(SND_EMU10K1_GPR_CONTROLS,
@@ -1824,8 +1824,8 @@ static int _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
 	if (!icode)
 		return err;
 
-	icode->gpr_map = (u_int32_t __user *) kcalloc(256 + 160 + 160 + 2 * 512,
-						      sizeof(u_int32_t), GFP_KERNEL);
+	icode->gpr_map = kcalloc(256 + 160 + 160 + 2 * 512,
+				sizeof(u_int32_t), GFP_KERNEL);
 	if (!icode->gpr_map)
 		goto __err_gpr;
 
Signature · 1 line
2.1.0
#1 lore raw

The subject need to be written by hand and they need to be unique.

git log --oneline driver/file.c
Copy and paste the patch prefix for each email you send.

Quoted 10 lines · Firo Yang
---
 sound/pci/emu10k1/emufx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
sound/pci/emu10k1/emufx.c +0 -0
index 56fc47b..8a39a6f 100644

sound/pci/emu10k1/emufx.c static int _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu) · line 1190

Quoted 5 lines
sound/pci/emu10k1/emufx.c +0 -2
@@ -1186,8 +1186,8 @@ static int _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu)
 	if (!icode)
 		return err;
 
-	icode->gpr_map = (u_int32_t __user *) kcalloc(512 + 256 + 256 + 2 * 1024,
-						      sizeof(u_int32_t), GFP_KERNEL);

This cast is special. It's a Sparse thing. Since I know you have Smatch installed you can do

	~/path/to/smatch/smatch_scripts/kchecker --sparse sound/pci/emu10k1/emufx.c

I'm not positive if you need a __force in there?

Anyway, don't remove this.

regards,
dan carpenter