Skip to contentSkip to conversation

ALSA: hda/realtek - cleanup a condition

PATCH In review Dan Carpenter 3 participants 3 messages Feb 6, 2012

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

PATCH 1/1 ALSA: hda/realtek - cleanup a condition

Sparse complains that "spec->multiout.dac_nids" is a pointer.

sound/pci/hda/patch_realtek.c:2321:37: error: incompatible types for operation (>)
sound/pci/hda/patch_realtek.c:2321:37: left side has type unsigned short const [usertype] *dac_nids
sound/pci/hda/patch_realtek.c:2321:37: right side has type int

I think the intent here was just to check if it was non-NULL, but please double check.

---
I don't have this hardware.

sound/pci/hda/patch_realtek.c +1 -1
index a8e82be..7da4fd7 100644
@@ -2318,7 +2318,7 @@ static int alc_build_pcms(struct hda_codec *codec)
 		 "%s Analog", codec->chip_name);
 	info->name = spec->stream_name_analog;
 
-	if (spec->multiout.dac_nids > 0) {
+	if (spec->multiout.dac_nids) {
 		p = spec->stream_analog_playback;
 		if (!p)
 			p = &alc_pcm_analog_playback;
#1 lore raw
Quoted 8 lines · Dan Carpenter

Sparse complains that "spec->multiout.dac_nids" is a pointer.

sound/pci/hda/patch_realtek.c:2321:37: error: incompatible types for operation (>)
sound/pci/hda/patch_realtek.c:2321:37: left side has type unsigned short const [usertype] *dac_nids
sound/pci/hda/patch_realtek.c:2321:37: right side has type int

I think the intent here was just to check if it was non-NULL, but please double check.

It could also have meant to be "if (spec->multiout.num_dacs > 0)", but either way, it seems very unlikely that the condition is false.

Signature · 2 lines
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
#2 lore raw

At Mon, 06 Feb 2012 09:06:11 +0100,

Quoted 8 lines · David Henningsson
Quoted 6 lines · Dan Carpenter

Sparse complains that "spec->multiout.dac_nids" is a pointer.

sound/pci/hda/patch_realtek.c:2321:37: error: incompatible types for operation (>)
sound/pci/hda/patch_realtek.c:2321:37: left side has type unsigned short const [usertype] *dac_nids
sound/pci/hda/patch_realtek.c:2321:37: right side has type int

Quoted 5 lines
Quoted 2 lines

I think the intent here was just to check if it was non-NULL, but please double check.

It could also have meant to be "if (spec->multiout.num_dacs > 0)", but either way, it seems very unlikely that the condition is false.

Yeah, I think so. Looks like David can read my old mind better than me through his crystal ball.

I'll fix it up. Thanks.

Takashi