Skip to contentSkip to conversation

sound: pci: lx6464es: Remove unneeded variable err

PATCH Applied Hariprasad Kelam 2 participants 3 messages Jul 10, 2019 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound: pci: lx6464es: Remove unneeded variable err

This patch fixes below issue reported by coccicheck sound/pci/lx6464es/lx6464es.c:256:5-8: Unneeded variable: "err". Return "0" on line 258

We cannot change return value as its registered with snd_pcm_ops->close

---
 sound/pci/lx6464es/lx6464es.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
sound/pci/lx6464es/lx6464es.c +1 -2
index 1771a6d..583ca73 100644
@@ -253,9 +253,8 @@ static int lx_pcm_open(struct snd_pcm_substream *substream)
 
 static int lx_pcm_close(struct snd_pcm_substream *substream)
 {
-	int err = 0;
 	dev_dbg(substream->pcm->card->dev, "->lx_pcm_close\n");
-	return err;
+	return 0;
 }
 
 static snd_pcm_uframes_t lx_pcm_stream_pointer(struct snd_pcm_substream
Signature · 1 line
2.7.4
Applied
#1 lore raw
Quoted 8 lines · Hariprasad Kelam

This patch fixes below issue reported by coccicheck sound/pci/lx6464es/lx6464es.c:256:5-8: Unneeded variable: "err". Return "0" on line 258

We cannot change return value as its registered with snd_pcm_ops->close

Applied, thanks.

Takashi

#2 lore raw
Quoted 8 lines · Takashi Iwai
Quoted 5 lines · Hariprasad Kelam

This patch fixes below issue reported by coccicheck sound/pci/lx6464es/lx6464es.c:256:5-8: Unneeded variable: "err". Return "0" on line 258

Quoted 5 lines
Quoted 3 lines

We cannot change return value as its registered with snd_pcm_ops->close

Applied, thanks.

Well, looking at the description above again, I'd drop the text

"We cannot change return value as its registered with
snd_pcm_ops->close"

because this is quite misleading. There is absolutely no need for changing the function return type.

thanks,

Takashi