lkml.org 
[lkml]   [2001]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [OT] style-curiosity

On 03.02 Tigran Aivazian wrote:
> On Fri, 2 Mar 2001, J . A . Magallon wrote:
> > for (c = misc_list.next; c != &misc_list; c = c->next)
> > {
> > if (c->minor == misc->minor) {
> > up(&misc_sem);
> > return -EBUSY;
> > }
> > }
>
> the above is good but the below is better:
>
> for (c = misc_list.next; c != &misc_list; c = c->next)
> if (c->minor == misc->minor) {
> up(&misc_sem);
> return -EBUSY;
> }
>

I have suffered so many bugs coming from bad grouping that I always put
the braces even if they are not needed.

--
J.A. Magallon $> cd pub
mailto:jamagallon@able.es $> more beer

Linux werewolf 2.4.2-ac8 #2 SMP Fri Mar 2 12:12:45 CET 2001 i686

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.029 / U:1.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site