All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: cs4281: remove redundant assignment to variable val and remove a goto
@ 2019-07-05  9:57 ` Colin King
  0 siblings, 0 replies; 10+ messages in thread
From: Colin King @ 2019-07-05  9:57 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, alsa-devel; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable val is being assigned with a value that is never
read and it is being updated later with a new value. The
assignment is redundant and can be removed.  Also remove a
goto statement and a label and replace with a break statement.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 sound/pci/cs4281.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index a2cce3ecda6f..04c712647853 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -694,7 +694,7 @@ static int snd_cs4281_trigger(struct snd_pcm_substream *substream, int cmd)
 
 static unsigned int snd_cs4281_rate(unsigned int rate, unsigned int *real_rate)
 {
-	unsigned int val = ~0;
+	unsigned int val;
 	
 	if (real_rate)
 		*real_rate = rate;
@@ -707,9 +707,8 @@ static unsigned int snd_cs4281_rate(unsigned int rate, unsigned int *real_rate)
 	case 44100:	return 1;
 	case 48000:	return 0;
 	default:
-		goto __variable;
+		break;
 	}
-      __variable:
 	val = 1536000 / rate;
 	if (real_rate)
 		*real_rate = 1536000 / val;
-- 
2.20.1

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

end of thread, other threads:[~2019-07-05 10:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-05  9:57 [PATCH] ALSA: cs4281: remove redundant assignment to variable val and remove a goto Colin King
2019-07-05  9:57 ` Colin King
2019-07-05 10:12 ` Takashi Iwai
2019-07-05 10:12   ` Takashi Iwai
2019-07-05 10:12   ` Takashi Iwai
2019-07-05 10:20 ` walter harms
2019-07-05 10:20   ` walter harms
2019-07-05 10:36   ` Takashi Iwai
2019-07-05 10:36     ` Takashi Iwai
2019-07-05 10:36     ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.