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

From: Jeremy Fitzhardinge
Date: Sat May 24 2008 - 12:03:44 EST


Vegard Nossum wrote:
Why not use all-lowercase config_* names? It seems elegant, and fits
in with the notion that these are to be used not as macros, but as
ordinary constants.

We tend to use all caps for symbolic constants, even if they're enums.

(The only disadvantage I can see is that they will stand out less. But
I don't know how great the disadvantage is.)

You could even go further and make them real constants, something
along the lines of:

enum config_value { no, yes, mod };

static const enum config_value config_lockdep_support = yes;

Well, you could use "enum { config_foo = 0/1 }" to define a proper C constant.

But it means you could only use them in C, not in CPP or asm expressions.

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