Skip to contentSkip to conversation

ALSA: echoaudio: remove redundant assignment to variable bytes

PATCH Applied Colin Ian King 2 participants 2 messages Mar 2, 2022 – Mar 4, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: echoaudio: remove redundant assignment to variable bytes

The variable bytes is being assigned a value that is never read, it is being re-assigned inside a following if block. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
sound/pci/echoaudio/midi.c:211:9: warning: Although the value stored to 'bytes' is used in the enclosing expression, the value is never actually read from 'bytes' [deadcode.DeadStores]

---
 sound/pci/echoaudio/midi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/echoaudio/midi.c +1 -1
index cb72d27e809e..7be5c3327b16 100644
@@ -208,7 +208,7 @@ static void snd_echo_midi_output_write(struct timer_list *t)
 
 	/* No interrupts are involved: we have to check at regular intervals
 	if the card's output buffer has room for new data. */
-	sent = bytes = 0;
+	sent = 0;
 	spin_lock_irqsave(&chip->lock, flags);
 	chip->midi_full = 0;
 	if (!snd_rawmidi_transmit_empty(chip->midi_out)) {
Signature · 1 line
2.34.1
Applied
#1 lore raw
Quoted 11 lines · Colin Ian King

The variable bytes is being assigned a value that is never read, it is being re-assigned inside a following if block. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
sound/pci/echoaudio/midi.c:211:9: warning: Although the value stored to 'bytes' is used in the enclosing expression, the value is never actually read from 'bytes' [deadcode.DeadStores]

Thanks, applied.

Takashi