From: Takashi Iwai Subject: Re: ALSA: hda - Use generic parser for Cirrus codec driver Date: Fri, 24 Jul 2015 18:18:32 +0200 Message-ID: References: <20150724161227.GA12423@mwanda> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 118372605C3 for ; Fri, 24 Jul 2015 18:18:35 +0200 (CEST) In-Reply-To: <20150724161227.GA12423@mwanda> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Dan Carpenter Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On Fri, 24 Jul 2015 18:12:28 +0200, Dan Carpenter wrote: > > Hello Takashi Iwai, > > The patch 1077a024812d: "ALSA: hda - Use generic parser for Cirrus > codec driver" from Dec 19, 2012, leads to the following static > checker warning: > > sound/pci/hda/patch_cirrus.c:1004 cs4210_spdif_automute() > warn: we tested 'spdif_present' before and it was 'true' > > sound/pci/hda/patch_cirrus.c > 984 static void cs4210_spdif_automute(struct hda_codec *codec, > 985 struct hda_jack_callback *tbl) > 986 { > 987 struct cs_spec *spec = codec->spec; > 988 bool spdif_present = false; > 989 hda_nid_t spdif_pin = spec->gen.autocfg.dig_out_pins[0]; > 990 > 991 /* detect on spdif is specific to CS4210 */ > 992 if (!spec->spdif_detect || > 993 spec->vendor_nid != CS4210_VENDOR_NID) > 994 return; > 995 > 996 spdif_present = snd_hda_jack_detect(codec, spdif_pin); > 997 if (spdif_present == spec->spdif_present) > 998 return; > 999 > 1000 spec->spdif_present = spdif_present; > 1001 /* SPDIF TX on/off */ > 1002 if (spdif_present) > ^^^^^^^^^^^^^ > 1003 snd_hda_set_pin_ctl(codec, spdif_pin, > 1004 spdif_present ? PIN_OUT : 0); > ^^^^^^^^^^^^^ > > I'm not positive but I think this is buggy. We should remove the if > statement. Yes, looks so. Could you submit a fix patch? Thanks! Takashi