Re: [PATCH] dbri: more cleanups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Sat, 1 Sep 2007 22:57:30 +0200,
Krzysztof Helt wrote:
> 
> From: Krzysztof Helt <krzysztof.h1@xxxxx>
> 
> 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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux