linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: echoaudio: remove redundant assignment to variable bytes
@ 2022-03-02 17:07 Colin Ian King
  2022-03-04  8:51 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-03-02 17:07 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, alsa-devel
  Cc: kernel-janitors, linux-kernel, llvm

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]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 sound/pci/echoaudio/midi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/echoaudio/midi.c b/sound/pci/echoaudio/midi.c
index cb72d27e809e..7be5c3327b16 100644
--- a/sound/pci/echoaudio/midi.c
+++ b/sound/pci/echoaudio/midi.c
@@ -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)) {
-- 
2.34.1


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

* Re: [PATCH] ALSA: echoaudio: remove redundant assignment to variable bytes
  2022-03-02 17:07 [PATCH] ALSA: echoaudio: remove redundant assignment to variable bytes Colin Ian King
@ 2022-03-04  8:51 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2022-03-04  8:51 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel, kernel-janitors,
	linux-kernel, llvm

On Wed, 02 Mar 2022 18:07:28 +0100,
Colin Ian King wrote:
> 
> 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]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Thanks, applied.


Takashi

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

end of thread, other threads:[~2022-03-04  8:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-02 17:07 [PATCH] ALSA: echoaudio: remove redundant assignment to variable bytes Colin Ian King
2022-03-04  8:51 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).