From: Takashi Iwai Subject: Re: [PATCH] snd-hda-intel: Jack Mode changes for Sigmatel boards Date: Wed, 27 May 2009 09:20:59 +0200 Message-ID: References: <4A13F91D.8010102@gmail.com> <4A1AEF14.1090608@gmail.com> 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 mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 5DD692464E for ; Wed, 27 May 2009 09:21:00 +0200 (CEST) In-Reply-To: <4A1AEF14.1090608@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Nickolas Lloyd Cc: alsa-devel@alsa-project.org, Matthew Ranostay List-Id: alsa-devel@alsa-project.org At Mon, 25 May 2009 19:18:44 +0000, Nickolas Lloyd wrote: > > + nid = cfg->input_pins[AUTO_PIN_MIC]; > + idx = 0; > + > +again: > + if (nid) { > + err = stac92xx_add_mic_jack_control(codec, nid, idx); > if (err < 0) > return err; > + else if (!err) > + idx++; > + } > + > + if (nid == cfg->input_pins[AUTO_PIN_MIC]) { > + nid = cfg->input_pins[AUTO_PIN_FRONT_MIC]; > + goto again; > } Well, a goto loop is old-fashioned as a code in 21st century :) Also, it might be better to use auto_pin_cfg_labels[] to each unique control name instead of index. It's often more intuitive. Takashi