Skip to contentSkip to conversation

ALSA: echoaudio: remove redundant assignment to variable clock

PATCH Applied Colin Ian King 2 participants 2 messages Feb 21, 2024 – Feb 22, 2024

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

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

The variable clock is being assigned a value that is never read, it is being re-assigned a new value in every case in the following switch statement. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
sound/pci/echoaudio/echoaudio_3g.c:277:2: warning: Value stored to 'clock' is never read [deadcode.DeadStores]

---
 sound/pci/echoaudio/echoaudio_3g.c | 1 -
 1 file changed, 1 deletion(-)
sound/pci/echoaudio/echoaudio_3g.c +0 -1
index cc3c79387194..18b4d4b4d38d 100644
@@ -274,7 +274,6 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
 		       chip->digital_mode == DIGITAL_MODE_ADAT))
 		return -EINVAL;
 
-	clock = 0;
 	control_reg = le32_to_cpu(chip->comm_page->control_register);
 	control_reg &= E3G_CLOCK_CLEAR_MASK;
 
Signature · 1 line
2.39.2
Applied
#1 lore raw
Quoted 10 lines · Colin Ian King

The variable clock is being assigned a value that is never read, it is being re-assigned a new value in every case in the following switch statement. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
sound/pci/echoaudio/echoaudio_3g.c:277:2: warning: Value stored to 'clock' is never read [deadcode.DeadStores]

Thanks, applied.

Takashi