[v4,12/22] stack: stop using variadic argument pack extension

Message ID 1709236433-15428-13-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. 29, 2024, 7:53 p.m. UTC
  Use RTE_LOG_LINE_PREFIX instead of RTE_LOG_LINE 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/stack/stack_pvt.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
  

Patch

diff --git a/lib/stack/stack_pvt.h b/lib/stack/stack_pvt.h
index 2dce42a..fc95796 100644
--- a/lib/stack/stack_pvt.h
+++ b/lib/stack/stack_pvt.h
@@ -10,16 +10,16 @@ 
 extern int stack_logtype;
 #define RTE_LOGTYPE_STACK stack_logtype
 
-#define STACK_LOG(level, fmt, args...) \
-	RTE_LOG_LINE(level, STACK, "%s(): "fmt, __func__, ##args)
+#define STACK_LOG(level, ...) \
+	RTE_LOG_LINE_PREFIX(level, STACK, "%s(): ", __func__, __VA_ARGS__)
 
-#define STACK_LOG_ERR(fmt, args...) \
-	STACK_LOG(ERR, fmt, ## args)
+#define STACK_LOG_ERR(...) \
+	STACK_LOG(ERR, __VA_ARGS__)
 
-#define STACK_LOG_WARN(fmt, args...) \
-	STACK_LOG(WARNING, fmt, ## args)
+#define STACK_LOG_WARN(...) \
+	STACK_LOG(WARNING, __VA_ARGS__)
 
-#define STACK_LOG_INFO(fmt, args...) \
-	STACK_LOG(INFO, fmt, ## args)
+#define STACK_LOG_INFO(fmt, ...) \
+	STACK_LOG(INFO, __VA_ARGS__)
 
 #endif /* _STACK_PVT_H_ */