lkml.org 
[lkml]   [2006]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH][RFC] mm: swsusp shrink_all_memory tweaks
    Con Kolivas wrote:
    > On Saturday 18 March 2006 15:52, Nick Piggin wrote:
    >
    >>Con Kolivas wrote:
    >>
    >>>
    >>>#ifdeffery
    >>
    >>Sorry I don't understand...
    >
    >
    > My bad.
    >
    > I added the suspend_pass member to struct scan_control within an #ifdef
    > CONFIG_PM to allow it to not be unnecessarily compiled in in the !CONFIG_PM
    > case and wanted to avoid having the #ifdefs in vmscan.c so moved it to a
    > header file.
    >

    Oh no, that rule thumb isn't actually "don't put ifdefs in .c files", but
    people commonly say it that way anyway. The rule is actually that you should
    put ifdefs in declarations rather than call/usage sites.

    You did the right thing there by introducing the accessor, which moves the
    ifdef out of code that wants to query the member right? But you can still
    leave it in the .c file if it is local (which it is).

    --
    SUSE Labs, Novell Inc.
    Send instant messages to your online friends http://au.messenger.yahoo.com

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-03-18 06:47    [W:4.090 / U:0.152 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site