lkml.org 
[lkml]   [2013]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH 0/2] vsprintf: ignore %n again
    Sure.  There are a lot of non-const strings though.

    diff --git a/include/linux/printk.h b/include/linux/printk.h
    index e6131a78..317587b 100644
    --- a/include/linux/printk.h
    +++ b/include/linux/printk.h
    @@ -122,6 +122,11 @@ asmlinkage int printk_emit(int facility, int level,

    asmlinkage __printf(1, 2) __cold
    int printk(const char *fmt, ...);
    +#define printk(fmt, ...) do { \
    + compiletime_assert(__builtin_constant_p(fmt), \
    + "Non-constant format string"); \
    + printk(fmt, ##__VA_ARGS__); \
    +} while (0)

    /*
    * Special printk facility for scheduler use only, _DO_NOT_USE_ !

    \
     
     \ /
      Last update: 2013-09-18 16:21    [W:5.479 / U:0.088 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site