From 0e59375ac5bc6e88f324b6d4d8b823ddc9d6f574 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Thu, 23 Sep 2021 10:25:04 +1000 Subject: [PATCH] debug: Add a level of indirection to ring buffer logging Add an internal function to do the work and call it. It will be called again in a subsequent commit. Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke --- lib/util/debug.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/util/debug.c b/lib/util/debug.c index 51fd3d0641a..fc6c0435bf1 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -368,9 +368,8 @@ static void debug_ringbuf_reload(bool enabled, bool previously_enabled, } } -static void debug_ringbuf_log(int msg_level, - const char *msg, - const char *msg_no_nl) +static void _debug_ringbuf_log(int msg_level, + const char *msg) { size_t msglen = strlen(msg); size_t allowed_size; @@ -398,6 +397,13 @@ static void debug_ringbuf_log(int msg_level, debug_ringbuf_ofs += msglen; } +static void debug_ringbuf_log(int msg_level, + const char *msg, + const char *msg_no_nl) +{ + _debug_ringbuf_log(msg_level, msg); +} + static struct debug_backend { const char *name; int log_level; -- 2.11.4.GIT