From 092bfd5eb55d1b2d7ed098aa9723a2fa63b86192 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 15 Feb 2013 16:26:38 +0100 Subject: fix another brown paper bag bug introduced with compile time loglevel __pr_printk is a define which uses a local variable 'ret'. This means that whenever someone does a pr_*("ret: %d\n", ret); ret will be 0. Fix this by writing this without a local variable. Signed-off-by: Sascha Hauer --- include/printk.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/printk.h b/include/printk.h index 3de890547..3cd733547 100644 --- a/include/printk.h +++ b/include/printk.h @@ -46,10 +46,7 @@ int dev_printf(const struct device_d *dev, const char *format, ...) #define __pr_printk(level, format, args...) \ ({ \ - int ret = 0; \ - if (level <= LOGLEVEL) \ - ret = printk(format, ##args); \ - ret; \ + (level) <= LOGLEVEL ? printk((format), ##args) : 0; \ }) #ifndef pr_fmt -- cgit v1.2.3