Commit c406ccc0 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

log: Make pr_err_once to use pr_err

No need for core duplication.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 7dccef3a
......@@ -31,22 +31,20 @@ extern void print_on_level(unsigned int loglevel, const char *format, ...)
print_on_level(LOG_INFO, \
LOG_PREFIX fmt, ##__VA_ARGS__)
#define pr_err(fmt, ...) \
print_on_level(LOG_ERROR, \
"Error (%s:%d): " LOG_PREFIX fmt, \
__FILE__, __LINE__, ##__VA_ARGS__)
#define pr_err_once(fmt, ...) \
do { \
static bool __printed; \
if (!__printed) { \
print_on_level(LOG_ERROR, \
"Error (%s:%d): " LOG_PREFIX fmt, \
__FILE__, __LINE__, ##__VA_ARGS__); \
pr_err(fmt, ##__VA_ARGS__); \
__printed = 1; \
} \
} while (0)
#define pr_err(fmt, ...) \
print_on_level(LOG_ERROR, \
"Error (%s:%d): " LOG_PREFIX fmt, \
__FILE__, __LINE__, ##__VA_ARGS__)
#define pr_warn(fmt, ...) \
print_on_level(LOG_WARN, \
"Warn (%s:%d): " LOG_PREFIX fmt, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment