* [patch] ALSA: hda/realtek - cleanup a condition
@ 2012-02-06 7:52 Dan Carpenter
2012-02-06 8:06 ` [alsa-devel] " David Henningsson
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2012-02-06 7:52 UTC (permalink / raw)
To: Jaroslav Kysela
Cc: Takashi Iwai, alsa-devel, kernel-janitors, David Henningsson
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.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I don't have this hardware.
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index a8e82be..7da4fd7 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [alsa-devel] [patch] ALSA: hda/realtek - cleanup a condition
2012-02-06 7:52 [patch] ALSA: hda/realtek - cleanup a condition Dan Carpenter
@ 2012-02-06 8:06 ` David Henningsson
2012-02-06 9:09 ` Takashi Iwai
0 siblings, 1 reply; 3+ messages in thread
From: David Henningsson @ 2012-02-06 8:06 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Takashi Iwai, alsa-devel, kernel-janitors
On 02/06/2012 08:52 AM, Dan Carpenter wrote:
> 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.
--
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [alsa-devel] [patch] ALSA: hda/realtek - cleanup a condition
2012-02-06 8:06 ` [alsa-devel] " David Henningsson
@ 2012-02-06 9:09 ` Takashi Iwai
0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2012-02-06 9:09 UTC (permalink / raw)
To: David Henningsson; +Cc: alsa-devel, kernel-janitors, Dan Carpenter
At Mon, 06 Feb 2012 09:06:11 +0100,
David Henningsson wrote:
>
> On 02/06/2012 08:52 AM, Dan Carpenter wrote:
> > 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.
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-06 9:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-06 7:52 [patch] ALSA: hda/realtek - cleanup a condition Dan Carpenter
2012-02-06 8:06 ` [alsa-devel] " David Henningsson
2012-02-06 9:09 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox