summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-02-15 16:26:38 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-03-06 23:53:04 +0100
commit092bfd5eb55d1b2d7ed098aa9723a2fa63b86192 (patch)
tree736de5366eb62dc8fe6a6506ea8b7fcbb9a7bd46
parentc1f4371f66732a6bb0f39e5e385d85321ac9810b (diff)
downloadbarebox-092bfd5eb55d1b2d7ed098aa9723a2fa63b86192.tar.gz
barebox-092bfd5eb55d1b2d7ed098aa9723a2fa63b86192.tar.xz
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 <s.hauer@pengutronix.de>
-rw-r--r--include/printk.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/printk.h b/include/printk.h
index 3de890547e..3cd733547e 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