[v4,10/22] rawdev: stop using variadic argument pack extension

Message ID 1709236433-15428-11-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/rawdev/rte_rawdev_pmd.h | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
  

Patch

diff --git a/lib/rawdev/rte_rawdev_pmd.h b/lib/rawdev/rte_rawdev_pmd.h
index 7173282..22b4064 100644
--- a/lib/rawdev/rte_rawdev_pmd.h
+++ b/lib/rawdev/rte_rawdev_pmd.h
@@ -30,16 +30,17 @@ 
 #define RTE_LOGTYPE_RAWDEV librawdev_logtype
 
 /* Logging Macros */
-#define RTE_RDEV_LOG(level, fmt, args...) \
-	RTE_LOG_LINE(level, RAWDEV, "%s(): " fmt, __func__, ##args)
+#define RTE_RDEV_LOG(level, ...) \
+	RTE_LOG_LINE_PREFIX(level, RAWDEV, "%s(): ", __func__, __VA_ARGS__)
 
-#define RTE_RDEV_ERR(fmt, args...) \
-	RTE_RDEV_LOG(ERR, fmt, ## args)
-#define RTE_RDEV_DEBUG(fmt, args...) \
-	RTE_RDEV_LOG(DEBUG, fmt, ## args)
-#define RTE_RDEV_INFO(fmt, args...) \
-	RTE_RDEV_LOG(INFO, fmt, ## args)
+#define RTE_RDEV_ERR(...) \
+	RTE_RDEV_LOG(ERR, __VA_ARGS__)
 
+#define RTE_RDEV_DEBUG(...) \
+	RTE_RDEV_LOG(DEBUG, __VA_ARGS__)
+
+#define RTE_RDEV_INFO(...) \
+	RTE_RDEV_LOG(INFO, __VA_ARGS__)
 
 /* Macros to check for valid device */
 #define RTE_RAWDEV_VALID_DEVID_OR_ERR_RET(dev_id, retval) do { \