lkml.org 
[lkml]   [2011]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [patch] x86, mm: Clean up initmem_init

    * David Rientjes <rientjes@google.com> wrote:

    > On Thu, 3 Mar 2011, Yinghai Lu wrote:
    >
    > > he want
    > >
    > > > +#ifdef CONFIG_ACPI_NUMA
    > > >> > + ret = numa_init(x86_acpi_numa_init);
    > > >> > + if (!ret)
    > > >> > + return;
    > > >> > +#endif
    > > >> > +#ifdef CONFIG_AMD_NUMA
    > > >> > + ret = numa_init(amd_numa_init);
    > > >> > + if (!ret)
    > > >> > + return;
    > > >> > +#endif
    > >
    > > to be replaced by:
    > >
    > > > +#ifdef CONFIG_ACPI_NUMA
    > > >> > + if (!numa_init(x86_acpi_numa_init))
    > > >> > + return;
    > > >> > +#endif
    > > >> > +#ifdef CONFIG_AMD_NUMA
    > > >> > + if (!numa_init(amd_numa_init))
    > > >> > + return;
    > > >> > +#endif
    >
    > It's a matter of style and I think it's up to Ingo what he'd prefer to
    > see.

    I think your variant is cleaner: hiding function call side-effects in conditionscan
    be a fragile thing to do. We want constant expressions with no side-effects - so if
    functions are called they should be constant functions as well.

    Code compactness isn't everything - if it was we'd be using C to the max to create
    unreadable compound expressions all the time.

    Thanks,

    Ingo


    \
     
     \ /
      Last update: 2011-03-04 08:11    [from the cache]
    ©2003-2014 Jasper Spaans. hosted at Digital Ocean