From 95d62baac5daf39fc76bdffa600ffa2d5e36b25f Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Fri, 16 Nov 2018 12:26:17 +0000 Subject: [PATCH] loader: deduplicate logger function declaration Signed-off-by: Eric Engestrom Reviewed-by: Emil Velikov --- src/loader/loader.c | 4 ++-- src/loader/loader.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/loader/loader.c b/src/loader/loader.c index 05140b6d18f..0f799c14fd8 100644 --- a/src/loader/loader.c +++ b/src/loader/loader.c @@ -68,7 +68,7 @@ static void default_logger(int level, const char *fmt, ...) } } -static void (*log_)(int level, const char *fmt, ...) = default_logger; +static loader_logger *log_ = default_logger; int loader_open_device(const char *device_name) @@ -491,7 +491,7 @@ out: } void -loader_set_logger(void (*logger)(int level, const char *fmt, ...)) +loader_set_logger(loader_logger *logger) { log_ = logger; } diff --git a/src/loader/loader.h b/src/loader/loader.h index 779ec44b75d..d063ab3f6c4 100644 --- a/src/loader/loader.h +++ b/src/loader/loader.h @@ -74,8 +74,9 @@ loader_get_user_preferred_fd(int default_fd, bool *different_device); #define _LOADER_INFO 2 /* just useful info */ #define _LOADER_DEBUG 3 /* useful info for debugging */ +typedef void loader_logger(int level, const char *fmt, ...); void -loader_set_logger(void (*logger)(int level, const char *fmt, ...)); +loader_set_logger(loader_logger *logger); char * loader_get_extensions_name(const char *driver_name); -- 2.30.2