Messages in this thread Patch in this message | | | Date | Wed, 18 Sep 2013 17:11:04 +0300 | From | Dan Carpenter <> | Subject | Re: [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_ !
| |