Re: kernel coding style for if ... else which cross #ifdef

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Sam Ravnborg <sam@...>
Cc: H. Peter Anvin <hpa@...>, Steve French <smfrench@...>, lkml <linux-kernel@...>
Date: Saturday, May 24, 2008 - 6:06 am

Sam Ravnborg wrote:

They should be plain 0/1 booleans.  For a bool/tristate option FOO, it 
would define:

Enabled y:

    #define CONFIG_FOO
    #define CFG_FOO   1
    #undef CONFIG_FOO_MODULE
    #define CFG_FOO_MODULE 0


Enabled m:

    #define CONFIG_FOO
    #define CFG_FOO   1
    #define CONFIG_FOO_MODULE
    #define CFG_FOO_MODULE 1


Disabled n:

    #undef CONFIG_FOO
    #define CFG_FOO   0
    #undef CONFIG_FOO_MODULE
    #define CFG_FOO_MODULE 0

Not sure what CFG_* should be for string/numeric options.  Probably "1" 
if the value is defined, "0" if not, with CONFIG_* being the actual 
value (so a CONFIG_ value of 0 is distinguishable from not defined).

    J
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
kernel coding style for if ... else which cross #ifdef, Steve French, (Fri May 23, 3:11 pm)
Re: kernel coding style for if ... else which cross #ifdef, H. Peter Anvin, (Fri May 23, 7:03 pm)
Re: kernel coding style for if ... else which cross #ifdef, H. Peter Anvin, (Sat May 24, 1:42 am)
Re: kernel coding style for if ... else which cross #ifdef, H. Peter Anvin, (Sat May 24, 2:08 pm)
Re: kernel coding style for if ... else which cross #ifdef, Jeremy Fitzhardinge, (Sat May 24, 6:06 am)
Re: kernel coding style for if ... else which cross #ifdef, Jeremy Fitzhardinge, (Sat May 24, 10:35 am)
Re: kernel coding style for if ... else which cross #ifdef, Jeremy Fitzhardinge, (Sat May 24, 11:45 am)
Re: kernel coding style for if ... else which cross #ifdef, H. Peter Anvin, (Sat May 24, 2:12 pm)
Re: kernel coding style for if ... else which cross #ifdef, Vegard Nossum, (Sat May 24, 11:57 am)
Re: kernel coding style for if ... else which cross #ifdef, H. Peter Anvin, (Sat May 24, 2:12 pm)
Re: kernel coding style for if ... else which cross #ifdef, Jeremy Fitzhardinge, (Sat May 24, 12:02 pm)
Re: kernel coding style for if ... else which cross #ifdef, Jeremy Fitzhardinge, (Sat May 24, 4:38 pm)
Re: kernel coding style for if ... else which cross #ifdef, H. Peter Anvin, (Sat May 24, 4:43 pm)
Re: kernel coding style for if ... else which cross #ifdef, Jeremy Fitzhardinge, (Sat May 24, 4:51 pm)
Re: kernel coding style for if ... else which cross #ifdef, H. Peter Anvin, (Sat May 24, 4:54 pm)
Re: kernel coding style for if ... else which cross #ifdef, Jeremy Fitzhardinge, (Sat May 24, 5:15 pm)
Re: kernel coding style for if ... else which cross #ifdef, H. Peter Anvin, (Sun May 25, 8:27 pm)
Re: kernel coding style for if ... else which cross #ifdef, Willy Tarreau, (Sat May 24, 10:39 am)
Re: kernel coding style for if ... else which cross #ifdef, Jeremy Fitzhardinge, (Sat May 24, 10:41 am)
Re: kernel coding style for if ... else which cross #ifdef, Willy Tarreau, (Sat May 24, 10:46 am)