From 993a06b6144d54ae2ad83cc25c18acb9d1720ad0 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 17 Oct 2020 14:31:57 +0200 Subject: log: move processing_msg to global data Replace the static variable processing_msg by a field in the global data. Make the field bool at it can only be true or false. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- common/log.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'common/log.c') diff --git a/common/log.c b/common/log.c index b7a6ebe298..6a59f2ebe5 100644 --- a/common/log.c +++ b/common/log.c @@ -199,24 +199,23 @@ static bool log_passes_filters(struct log_device *ldev, struct log_rec *rec) static int log_dispatch(struct log_rec *rec) { struct log_device *ldev; - static int processing_msg; /* * When a log driver writes messages (e.g. via the network stack) this * may result in further generated messages. We cannot process them here * as this might result in infinite recursion. */ - if (processing_msg) + if (gd->processing_msg) return 0; /* Emit message */ - processing_msg = 1; + gd->processing_msg = true; list_for_each_entry(ldev, &gd->log_head, sibling_node) { if ((ldev->flags & LOGDF_ENABLE) && log_passes_filters(ldev, rec)) ldev->drv->emit(ldev, rec); } - processing_msg = 0; + gd->processing_msg = false; return 0; } -- cgit