Skip to contentSkip to conversation

ALSA: hdsp: remove redundant assignment to pointer kctl

PATCH Applied Colin Ian King 2 participants 2 messages May 8, 2022 – May 9, 2022

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

PATCH 1/1 ALSA: hdsp: remove redundant assignment to pointer kctl

Pointer kctl is being assigned a value that is not being read, buf is being re-assigned later. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
sound/pci/rme9652/hdsp.c:3317:28: warning: Although the value stored to 'kctl' is used in the enclosing expression, the value is never actually read from 'kctl' [deadcode.DeadStores]

---
 sound/pci/rme9652/hdsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/rme9652/hdsp.c +1 -1
index 3db641318d3a..dcc43a81ae0e 100644
@@ -3314,7 +3314,7 @@ static int snd_hdsp_create_controls(struct snd_card *card, struct hdsp *hdsp)
 	if (hdsp->io_type == RPM) {
 		/* RPM Bypass, Disconnect and Input switches */
 		for (idx = 0; idx < ARRAY_SIZE(snd_hdsp_rpm_controls); idx++) {
-			err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_hdsp_rpm_controls[idx], hdsp));
+			err = snd_ctl_add(card, snd_ctl_new1(&snd_hdsp_rpm_controls[idx], hdsp));
 			if (err < 0)
 				return err;
 		}
Signature · 1 line
2.35.1
Applied
#1 lore raw
Quoted 11 lines · Colin Ian King

Pointer kctl is being assigned a value that is not being read, buf is being re-assigned later. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
sound/pci/rme9652/hdsp.c:3317:28: warning: Although the value stored to 'kctl' is used in the enclosing expression, the value is never actually read from 'kctl' [deadcode.DeadStores]

Thanks, applied.

Takashi