From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Brown Subject: Re: [PATCH] ASoC: Ensure we generate a driver name Date: Wed, 21 Sep 2011 13:41:21 +0100 Message-ID: <20110921124120.GE4374@opensource.wolfsonmicro.com> References: <1316524563-22407-1-git-send-email-broonie@opensource.wolfsonmicro.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 3D3962448D for ; Wed, 21 Sep 2011 14:41:22 +0200 (CEST) Content-Disposition: inline In-Reply-To: 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: Scott Jiang Cc: Takashi Iwai , uclinux-dist-devel@blackfin.uclinux.org, alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, Liam Girdwood List-Id: alsa-devel@alsa-project.org On Wed, Sep 21, 2011 at 01:09:30PM +0800, Scott Jiang wrote: > 2011/9/20 Mark Brown : > > + =A0 =A0 =A0 for (i =3D 0; i < ARRAY_SIZE(card->snd_card->driver); i++= ) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 switch (card->snd_card->driver[i]) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case '_': > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case '-': > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case '\0': > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 default: > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!isalnum(card->snd_ca= rd->driver[i])) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 card->snd= _card->driver[i] =3D '_'; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > + =A0 =A0 =A0 } > If '\0', we should break out of loop? It's really not worth the code complexity, we only run this once during probe and the array is fixed size and small.