Re: [RFC] New kernel-message logging API (take 2)

From: Vegard Nossum
Date: Fri Sep 28 2007 - 12:41:39 EST

On 9/28/07, Rob Landley <rob@xxxxxxxxxxx> wrote:
> On Friday 28 September 2007 7:11:03 am Vegard Nossum wrote:
> > wrong. We can, however, use KBUILD_MODNAME as a default value for
> > KPRINT_DRIVER, like:
> > static const char *KPRINT_DRIVER = KBUILD_MODNAME;
> > which would pre-process to something like:
> > static const char *KPRINT_DRIVER = "bcm43xx";
> Which has been known to result in the string getting written out to the .o
> file even if it's never used, just in case something tries to take its
> address. This is not the same as a #define.

Logic tells me that an unused static variable should never go into the
.o. If something tries to take its address, it's no longer unused.

> > This value can still be overridden using #define KPRINT_DRIVER "new
> > name".
> Not with -D on the command line though. Your #define would have to come after
> the declaration or else the declaration turns into 'char *"fred" = "george";'
> and you have a syntax error. Again, not synonymous with a #define...

Yeah, that's exactly what my e-mail was about. The macros
KPRINT_SUBSYSTEM and KPRINT_DRIVER are not defined on the command
line, but in each source file that wants this prefix, after the
variables with the same names have been declared in kprint.h. This is
intentional; they can be overridden with a define, otherwise, they'll
default to static-const string variables.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at