[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200802102020.45829.bzolnier@gmail.com>
Date: Sun, 10 Feb 2008 20:20:45 +0100
From: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
To: Ingo Molnar <mingo@...e.hu>
Cc: Marcin Slusarz <marcin.slusarz@...il.com>,
linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@....com.au>,
Thomas Gleixner <tglx@...utronix.de>,
Jason Wessel <jason.wessel@...driver.com>
Subject: Re: [3/6] kgdb: core
On Sunday 10 February 2008, Ingo Molnar wrote:
>
> * Marcin Slusarz <marcin.slusarz@...il.com> 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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists