From f4fb97c85082b964397a4e7930d7aa809ffd58f9 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 9 Oct 2015 21:37:12 +0200 Subject: [PATCH] cleanup: more readable code --- lib/log/log.c | 5 +---- lib/log/lvm-logging.h | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/log/log.c b/lib/log/log.c index 7f3136121..2f1be725b 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -49,10 +49,7 @@ static size_t _lvm_errmsg_len = 0; void init_log_fn(lvm2_log_fn_t log_fn) { - if (log_fn) - _lvm2_log_fn = log_fn; - else - _lvm2_log_fn = NULL; + _lvm2_log_fn = log_fn; } /* diff --git a/lib/log/lvm-logging.h b/lib/log/lvm-logging.h index 983da5b38..84bf3f429 100644 --- a/lib/log/lvm-logging.h +++ b/lib/log/lvm-logging.h @@ -16,9 +16,9 @@ #ifndef _LVM_LOGGING_H #define _LVM_LOGGING_H +__attribute__ ((format(printf, 5, 6))) void print_log(int level, const char *file, int line, int dm_errno_or_class, - const char *format, ...) - __attribute__ ((format(printf, 5, 6))); + const char *format, ...); #define LOG_LINE(l, x...) \ print_log(l, __FILE__, __LINE__ , 0, ## x)