Re: [RFC] Add PR_PREFIX to pr_xyz macros.

Linus Torvalds
2008-11-12T19:48:39Z

On Wed, 12 Nov 2008, Martin Schwidefsky wrote:
>
> +#ifndef PR_PREFIX
> +#define pr_fmt(format) format
> +#else
> +#define pr_fmt(format) PR_PREFIX ": " format
> +#endif
> +
> +#define pr_emerg(fmt, ...) \
> + printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)

So, why can't people just define their pr_fmt() macro directly, something
like

#define pr_fmt(fmt) \
"%s:%d " fmt, __FILE__, __LINE__

which seems to be much more useful and generic than forcing them to use
"PR_PREFIX"?

Linus