lkml.org 
[lkml]   [2008]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [3/6] kgdb: core
Date
On Sunday 10 February 2008, Ingo Molnar wrote:
>
> * Marcin Slusarz <marcin.slusarz@gmail.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 ]


\
 
 \ /
  Last update: 2008-02-10 20:09    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site