Re: [PATCH] FRV: Fix the section attribute on UP DECLARE_PER_CPU()

From: David Howells
Date: Wed Apr 15 2009 - 07:43:36 EST



Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> But yeah, I didn't look at all the details. It _looked_ pretty
> straightforward to just move the DEFINE/DECLARE stuff up, but there may well
> be something subtle I'm missing.

The problem is mainly one of #include recursion. There's way too much of it.

I wonder if we should replace the standard headerfile boilerplate:

#ifndef _THIS_HEADER_H
#define _THIS_HEADER_H
...
#endif /* _THIS_HEADER_H */

with something a bit nastier:

#ifndef _THIS_HEADER_H
#define _THIS_HEADER_H 1
...
#undef _THIS_HEADER_H
#define _THIS_HEADER_H 2
#elif _THIS_HEADER_H == 1
#error Recursive inclusion is not permitted
#endif /* _THIS_HEADER_H */

and make people break up their header files to avoid getting this error.

There are a number of problems with doing this, of course; the least of which
is that cpp has special code for handling the first case efficiently, IIRC.

David
--
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/