Re: [3/6] kgdb: core
From: Bartlomiej Zolnierkiewicz
Date: Sun Feb 10 2008 - 14:07:25 EST
On Sunday 10 February 2008, Ingo Molnar wrote:
>
> * Marcin Slusarz <marcin.slusarz@xxxxxxxxx> wrote:
>
> > > + if (CACHE_FLUSH_IS_SAFE) {
> > > + if (current->mm && addr < TASK_SIZE) {
> > > + flush_cache_range(current->mm->mmap_cache,
> > > + addr, addr + BREAK_INSTR_SIZE);
> > > + } else {
> > > + flush_icache_range(addr, addr +
> > > + BREAK_INSTR_SIZE);
> > > + }
> > > + }
> > unneeded braces (here and in many other places)
>
> this is a small detail, but you are wrong. These braces around
> multi-line statements are unneded _for the compiler_, but are very much
> wanted by humans. You'll see akpm, me and others reject/fix patches on a
> routine basis that make this cleanliness mistake. Please watch out for
> this when writing patches ;-)
>
> > if ()
> > else if ()
> > else
> >
> > will look better
>
> nope. I consciously avoid that construct because it's dangerous: it can
> quite easily result in the wrong logic. Having _more_ braces than needed
> by the compiler is a style error in only a single, special case.
however it can be still made to:
if () {
if ()
else
}
[ not fixed in v6 ]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/