public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* checkpatch and pr_fmt()?
@ 2008-12-18 16:24 Geert Uytterhoeven
  2009-03-10 18:36 ` Andy Whitcroft
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2008-12-18 16:24 UTC (permalink / raw)
  To: Andy Whitcroft, Joel Schopp, Randy Dunlap; +Cc: Linux Kernel Development

When using the recently introduced pr_fmt() infrastructure (commit
d091c2f58ba32029495a933b721e8e02fbd12caa, "Add 'pr_fmt()' format modifier to
pr_xyz macros."), checkpatch spits out the following annoying error:

| ERROR: Macros with complex values should be enclosed in parenthesis
| +#define pr_fmt(fmt)    "%s: " fmt, __func__

Unfortunately, adding parentheses is not a solution, as it creates illegal C
code.

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: checkpatch and pr_fmt()?
  2008-12-18 16:24 checkpatch and pr_fmt()? Geert Uytterhoeven
@ 2009-03-10 18:36 ` Andy Whitcroft
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Whitcroft @ 2009-03-10 18:36 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Joel Schopp, Randy Dunlap, Linux Kernel Development

On Thu, Dec 18, 2008 at 05:24:06PM +0100, Geert Uytterhoeven wrote:
> When using the recently introduced pr_fmt() infrastructure (commit
> d091c2f58ba32029495a933b721e8e02fbd12caa, "Add 'pr_fmt()' format modifier to
> pr_xyz macros."), checkpatch spits out the following annoying error:
> 
> | ERROR: Macros with complex values should be enclosed in parenthesis
> | +#define pr_fmt(fmt)    "%s: " fmt, __func__
> 
> Unfortunately, adding parentheses is not a solution, as it creates illegal C
> code.

Yeah that one looks like something we should avoid.  Fixed in my next
update which can be tested here:

  http://www.kernel.org/pub/linux/kernel/people/apw/checkpatch/checkpatch.pl-testing

-apw

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-10 19:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-18 16:24 checkpatch and pr_fmt()? Geert Uytterhoeven
2009-03-10 18:36 ` Andy Whitcroft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox