lkml.org 
[lkml]   [2008]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [3/6] kgdb: core
    On 10/02/2008, Marcin Slusarz <marcin.slusarz@gmail.com> wrote:
    > On Sun, Feb 10, 2008 at 08:13:31AM +0100, Ingo Molnar 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)
    >

    While they are not strictly needed, I for one would argue they should
    probably stay.

    if (foo)
    bar();

    is not always safe in case bar() is a macro.

    if (foo) {
    bar();
    }

    is always safe and is more robust when the code gets changed later
    since you don't accidentally end up with someone mistakenly turning it
    into

    if (foo)
    bar();
    baz();


    --
    Jesper Juhl <jesper.juhl@gmail.com>
    Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
    Plain text mails only, please http://www.expita.com/nomime.html


    \
     
     \ /
      Last update: 2008-02-10 14:23    [W:0.022 / U:88.996 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site