sound: pci: emu10k1: Remove unneeded variable "change"
PATCH 1/1 sound: pci: emu10k1: Remove unneeded variable "change"
fix below issue reported by coccicheck sound/pci/emu10k1/emu10k1x.c:1077:5-11: Unneeded variable: "change". Return "0" on line 1092
--- sound/pci/emu10k1/emu10k1x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/pci/emu10k1/emu10k1x.c +1 -2
@@ -1074,7 +1074,6 @@ static int snd_emu10k1x_shared_spdif_put(struct snd_kcontrol *kcontrol, {struct emu10k1x *emu =snd_kcontrol_chip (kcontrol);unsigned int val; -int change =0 ; val = ucontrol->value.integer.value[0 ] ;
@@ -1089,7 +1088,7 @@ static int snd_emu10k1x_shared_spdif_put(struct snd_kcontrol *kcontrol,snd_emu10k1x_ptr_write (emu,ROUTING ,0 ,0x1003F );snd_emu10k1x_gpio_write (emu,0x1080 ); } -return change; +return 0 ; } static const struct snd_kcontrol_new snd_emu10k1x_shared_spdif =
Signature · 1 line
2.7.4
Quoted 5 lines · Hariprasad Kelam
fix below issue reported by coccicheck sound/pci/emu10k1/emu10k1x.c:1077:5-11: Unneeded variable: "change". Return "0" on line 1092
Signed-off-by Hariprasad Kelam <[email protected]>
Since the function always return 0 and you perform code clean-up then maybe it would be a good idea to just change function to void instead of returning int value which does not seem to have use.
Michal W.
Quoted 17 lines
--- sound/pci/emu10k1/emu10k1x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)sound/pci/emu10k1/emu10k1x.c +0
-1@@ -1074,7 +1074,6 @@ static int snd_emu10k1x_shared_spdif_put(struct snd_kcontrol *kcontrol, {struct emu10k1x *emu =snd_kcontrol_chip (kcontrol);unsigned int val; -int change =0 ; val = ucontrol->value.integer.value[0 ] ;
sound/pci/emu10k1/emu10k1x.c static int snd_emu10k1x_shared_spdif_put(struct snd_kcontrol *kcontrol, · line 1094
Quoted 8 lines
sound/pci/emu10k1/emu10k1x.c +1
-1@@ -1089,7 +1088,7 @@ static int snd_emu10k1x_shared_spdif_put(struct snd_kcontrol *kcontrol,snd_emu10k1x_ptr_write (emu,ROUTING ,0 ,0x1003F );snd_emu10k1x_gpio_write (emu,0x1080 ); } -return change; +return 0 ; } static const struct snd_kcontrol_new snd_emu10k1x_shared_spdif =
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Quoted 8 lines · Michal
On 7/11/2019 7:17 PM, Hariprasad Kelam wrote:
fix below issue reported by coccicheck sound/pci/emu10k1/emu10k1x.c:1077:5-11: Unneeded variable: "change". Return "0" on line 1092
Quoted 5 lines
Signed-off-by Hariprasad Kelam <[email protected]>Since the function always return 0 and you perform code clean-up then maybe it would be a good idea to just change function to void instead of returning int value which does not seem to have use.
No, it's a callback function.
Takashi
Takashi Iwai
AppliedQuoted 6 lines · Hariprasad Kelam
fix below issue reported by coccicheck sound/pci/emu10k1/emu10k1x.c:1077:5-11: Unneeded variable: "change". Return "0" on line 1092
Signed-off-by Hariprasad Kelam <[email protected]>
Applied, thanks.
Takashi