lkml.org 
[lkml]   [2015]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] printk: help pr_debug and pr_devel to optimize out arguments
From
Date
On Wed, 2015-12-09 at 12:52 +0100, Arnd Bergmann wrote:
> On Friday 04 December 2015 16:51:42 Aaron Conole wrote:
> > --- a/include/linux/printk.h
> > +++ b/include/linux/printk.h
> > @@ -106,13 +106,14 @@ struct va_format {
> >  
> >  /*
> >   * Dummy printk for disabled debugging statements to use whilst maintaining
> > - * gcc's format and side-effect checking.
> > + * gcc's format checking.
> >   */
> > -static inline __printf(1, 2)
> > -int no_printk(const char *fmt, ...)
> > -{
> > -       return 0;
> > -}
> > +#define no_printk(fmt, ...)                    \
> > +do {                                           \
> > +       if (0) {                                \
> > +               printk(fmt, ##__VA_ARGS__);     \
> > +       }                                       \
> > +} while (0)
> >  
>
> This change breaks compiling lib/842/, at least in some configurations:
>
> lib/842/842_decompress.c: In function '__do_index':
> lib/842/842_decompress.c:205:12422: error: implicit declaration of function 'no_printk'

Please specify a configuration that fails.



\
 
 \ /
  Last update: 2015-12-09 17:01    [W:1.111 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site