Especially because it (using if instead of #if/#ifdef) only works for code
segments that don't rely on conditional elements of a struct, which are not
uncommon in the kernel sources.
Consider:
struct foo {
int bar;
#if CONFIG_FOO_BAZ
int baz;
#endif
};
and:
int init_foo(struct foo *initme)
{
initme->bar = 0;
#if CONFIG_FOO_BAZ
initme->baz = 0;
#endif
}
would work, while:
int init_foo(struct foo *initme)
{
initme->bar = 0;
if(CONFIG_FOO_BAZ) {
initme->baz = 0;
}
}
would generate compile errors if CONFIG_FOO_BAZ is zero, even though the
piece of code would be removed by the optimizer. This means that a simple
search/replacce is out of the question and that kernel development would be
more bothered by this kind of approach than IMHO is necessary.
Sincerely,
Jan-Derk Bakker.
-- Life. In order of importance: food, shelter and a pair of very loud speakers.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/