From: Takashi Iwai Subject: Re: [PATCH] dbri: more cleanups Date: Mon, 03 Sep 2007 14:46:38 +0200 Message-ID: References: <20070901225730.a9211c8a.krzysztof.h1@wp.pl> 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 EA4A9103888 for ; Mon, 3 Sep 2007 14:46:38 +0200 (CEST) In-Reply-To: <20070901225730.a9211c8a.krzysztof.h1@wp.pl> 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: Krzysztof Helt Cc: Alsa-devel List-Id: alsa-devel@alsa-project.org At Sat, 1 Sep 2007 22:57:30 +0200, Krzysztof Helt wrote: > > From: Krzysztof Helt > > This patch: > - removes redundant constant suffices > - removes redundant parentheses > - removes redundant curly brackets I don't think that removing braces blindly is a good idea. The removal of brace is good if the statement is a single line, but not for the multiple lines. For example, for (;;) { if (...) { ... } } It's especially true for the brace for multiple if. if (...) { if (...) ... } > @@ -2442,11 +2430,10 @@ static int __init snd_dbri_mixer(struct > card = dbri->card; > strcpy(card->mixername, card->shortname); > > - for (idx = 0; idx < ARRAY_SIZE(dbri_controls); idx++) { > + for (idx = 0; idx < ARRAY_SIZE(dbri_controls); idx++) > if ((err = snd_ctl_add(card, > snd_ctl_new1(&dbri_controls[idx], dbri))) < 0) > return err; > - } Let's split if ((er = ...)). > > @@ -2637,7 +2623,6 @@ static int __init dbri_attach(int prom_n > goto _err; > > if ((err = snd_dbri_mixer(dbri)) < 0) > - if ((err = snd_dbri_mixer(dbri)) < 0) > goto _err; > > /* /proc file handling */ Ditto. Thanks, Takashi