[v2,14/17] eal: stop using variadic argument pack extension

Message ID 1708645606-7514-15-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series stop using variadic argument pack extension |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff Feb. 22, 2024, 11:46 p.m. UTC
  Use RTE_LOG_LINE_PREFIX instead of EAL_LOG in macro expansions
which allow a prefix and arguments to be inserted into the log line
without the need to use the ## args variadic argument pack extension.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/eal/common/eal_trace.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Patch

diff --git a/lib/eal/common/eal_trace.h b/lib/eal/common/eal_trace.h
index bd082a0..bd24fcd 100644
--- a/lib/eal/common/eal_trace.h
+++ b/lib/eal/common/eal_trace.h
@@ -16,11 +16,11 @@ 
 #include "eal_private.h"
 #include "eal_thread.h"
 
-#define trace_err(fmt, args...) \
-	EAL_LOG(ERR, "%s():%u " fmt, __func__, __LINE__, ## args)
+#define trace_err(...) \
+	RTE_LOG_LINE_PREFIX(ERR, EAL, "%s():%u ", __func__ _RTE_LOG_COMMA __LINE__, __VA_ARGS__)
 
-#define trace_crit(fmt, args...) \
-	EAL_LOG(CRIT, "%s():%u " fmt, __func__, __LINE__, ## args)
+#define trace_crit(...) \
+	RTE_LOG_LINE_PREFIX(CRIT, EAL, "%s():%u ", __func__ _RTE_LOG_COMMA __LINE__, __VA_ARGS__)
 
 #define TRACE_CTF_MAGIC 0xC1FC1FC1
 #define TRACE_MAX_ARGS	32