Many places are using a GCC extension related to variadic macros,
where a name prepends the ellipsis. This results in a warning like
the one below when compiling the code with MSVC:

app\test-pmd\testpmd.h(1314): error C2608:
    invalid token '...' in macro parameter list

Variadic macros became a standard part of the C language with C99.
GCC, Clang and MSVC handle them properly.

The fix is to remove the prefix name (args... becomes ...) and use
__VA_ARGS__.

Signed-off-by: Andre Muezerie <andre...@linux.microsoft.com>
---
 drivers/crypto/caam_jr/caam_jr_log.h      | 28 +++++------
 drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h | 28 +++++------
 drivers/crypto/dpaa_sec/dpaa_sec_log.h    | 28 +++++------
 drivers/crypto/virtio/virtio_logs.h       | 60 +++++++++++------------
 4 files changed, 72 insertions(+), 72 deletions(-)

diff --git a/drivers/crypto/caam_jr/caam_jr_log.h 
b/drivers/crypto/caam_jr/caam_jr_log.h
index 7c50119106..18de668e10 100644
--- a/drivers/crypto/caam_jr/caam_jr_log.h
+++ b/drivers/crypto/caam_jr/caam_jr_log.h
@@ -18,24 +18,24 @@ extern int caam_jr_logtype;
 
 #define PMD_INIT_FUNC_TRACE() CAAM_JR_DEBUG(" >>")
 
-#define CAAM_JR_INFO(fmt, args...) \
-       CAAM_JR_LOG(INFO, fmt, ## args)
-#define CAAM_JR_ERR(fmt, args...) \
-       CAAM_JR_LOG(ERR, fmt, ## args)
-#define CAAM_JR_WARN(fmt, args...) \
-       CAAM_JR_LOG(WARNING, fmt, ## args)
+#define CAAM_JR_INFO(fmt, ...) \
+       CAAM_JR_LOG(INFO, fmt, ## __VA_ARGS__)
+#define CAAM_JR_ERR(fmt, ...) \
+       CAAM_JR_LOG(ERR, fmt, ## __VA_ARGS__)
+#define CAAM_JR_WARN(fmt, ...) \
+       CAAM_JR_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define CAAM_JR_DP_LOG(level, ...) \
        RTE_LOG_DP_LINE(level, CAAM_JR, __VA_ARGS__)
 
-#define CAAM_JR_DP_DEBUG(fmt, args...) \
-       CAAM_JR_DP_LOG(DEBUG, fmt, ## args)
-#define CAAM_JR_DP_INFO(fmt, args...) \
-       CAAM_JR_DP_LOG(INFO, fmt, ## args)
-#define CAAM_JR_DP_WARN(fmt, args...) \
-       CAAM_JR_DP_LOG(WARNING, fmt, ## args)
-#define CAAM_JR_DP_ERR(fmt, args...) \
-       CAAM_JR_DP_LOG(ERR, fmt, ## args)
+#define CAAM_JR_DP_DEBUG(fmt, ...) \
+       CAAM_JR_DP_LOG(DEBUG, fmt, ## __VA_ARGS__)
+#define CAAM_JR_DP_INFO(fmt, ...) \
+       CAAM_JR_DP_LOG(INFO, fmt, ## __VA_ARGS__)
+#define CAAM_JR_DP_WARN(fmt, ...) \
+       CAAM_JR_DP_LOG(WARNING, fmt, ## __VA_ARGS__)
+#define CAAM_JR_DP_ERR(fmt, ...) \
+       CAAM_JR_DP_LOG(ERR, fmt, ## __VA_ARGS__)
 
 #endif /* _CAAM_JR_LOG_H_ */
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h 
b/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h
index 53a5ebc760..5f2a0bf8e1 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h
@@ -19,25 +19,25 @@ extern int dpaa2_logtype_sec;
 
 #define PMD_INIT_FUNC_TRACE() DPAA2_SEC_DEBUG(">>")
 
-#define DPAA2_SEC_INFO(fmt, args...) \
-       DPAA2_SEC_LOG(INFO, fmt, ## args)
-#define DPAA2_SEC_ERR(fmt, args...) \
-       DPAA2_SEC_LOG(ERR, fmt, ## args)
-#define DPAA2_SEC_WARN(fmt, args...) \
-       DPAA2_SEC_LOG(WARNING, fmt, ## args)
+#define DPAA2_SEC_INFO(fmt, ...) \
+       DPAA2_SEC_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA2_SEC_ERR(fmt, ...) \
+       DPAA2_SEC_LOG(ERR, fmt, ## __VA_ARGS__)
+#define DPAA2_SEC_WARN(fmt, ...) \
+       DPAA2_SEC_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_SEC_DP_LOG(level, ...) \
        RTE_LOG_DP_LINE(level, DPAA2_SEC, __VA_ARGS__)
 
-#define DPAA2_SEC_DP_DEBUG(fmt, args...) \
-       DPAA2_SEC_DP_LOG(DEBUG, fmt, ## args)
-#define DPAA2_SEC_DP_INFO(fmt, args...) \
-       DPAA2_SEC_DP_LOG(INFO, fmt, ## args)
-#define DPAA2_SEC_DP_WARN(fmt, args...) \
-       DPAA2_SEC_DP_LOG(WARNING, fmt, ## args)
-#define DPAA2_SEC_DP_ERR(fmt, args...) \
-               DPAA2_SEC_DP_LOG(ERR, fmt, ## args)
+#define DPAA2_SEC_DP_DEBUG(fmt, ...) \
+       DPAA2_SEC_DP_LOG(DEBUG, fmt, ## __VA_ARGS__)
+#define DPAA2_SEC_DP_INFO(fmt, ...) \
+       DPAA2_SEC_DP_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA2_SEC_DP_WARN(fmt, ...) \
+       DPAA2_SEC_DP_LOG(WARNING, fmt, ## __VA_ARGS__)
+#define DPAA2_SEC_DP_ERR(fmt, ...) \
+               DPAA2_SEC_DP_LOG(ERR, fmt, ## __VA_ARGS__)
 
 
 #endif /* _DPAA2_SEC_LOGS_H_ */
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec_log.h 
b/drivers/crypto/dpaa_sec/dpaa_sec_log.h
index 6ac02d07e1..0413bcd6d3 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec_log.h
+++ b/drivers/crypto/dpaa_sec/dpaa_sec_log.h
@@ -19,24 +19,24 @@ extern int dpaa_logtype_sec;
 
 #define PMD_INIT_FUNC_TRACE() DPAA_SEC_DEBUG(" >>")
 
-#define DPAA_SEC_INFO(fmt, args...) \
-       DPAA_SEC_LOG(INFO, fmt, ## args)
-#define DPAA_SEC_ERR(fmt, args...) \
-       DPAA_SEC_LOG(ERR, fmt, ## args)
-#define DPAA_SEC_WARN(fmt, args...) \
-       DPAA_SEC_LOG(WARNING, fmt, ## args)
+#define DPAA_SEC_INFO(fmt, ...) \
+       DPAA_SEC_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA_SEC_ERR(fmt, ...) \
+       DPAA_SEC_LOG(ERR, fmt, ## __VA_ARGS__)
+#define DPAA_SEC_WARN(fmt, ...) \
+       DPAA_SEC_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA_SEC_DP_LOG(level, ...) \
        RTE_LOG_DP_LINE(level, DPAA_SEC, __VA_ARGS__)
 
-#define DPAA_SEC_DP_DEBUG(fmt, args...) \
-       DPAA_SEC_DP_LOG(DEBUG, fmt, ## args)
-#define DPAA_SEC_DP_INFO(fmt, args...) \
-       DPAA_SEC_DP_LOG(INFO, fmt, ## args)
-#define DPAA_SEC_DP_WARN(fmt, args...) \
-       DPAA_SEC_DP_LOG(WARNING, fmt, ## args)
-#define DPAA_SEC_DP_ERR(fmt, args...) \
-       DPAA_SEC_DP_LOG(ERR, fmt, ## args)
+#define DPAA_SEC_DP_DEBUG(fmt, ...) \
+       DPAA_SEC_DP_LOG(DEBUG, fmt, ## __VA_ARGS__)
+#define DPAA_SEC_DP_INFO(fmt, ...) \
+       DPAA_SEC_DP_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA_SEC_DP_WARN(fmt, ...) \
+       DPAA_SEC_DP_LOG(WARNING, fmt, ## __VA_ARGS__)
+#define DPAA_SEC_DP_ERR(fmt, ...) \
+       DPAA_SEC_DP_LOG(ERR, fmt, ## __VA_ARGS__)
 
 #endif /* _DPAA_SEC_LOG_H_ */
diff --git a/drivers/crypto/virtio/virtio_logs.h 
b/drivers/crypto/virtio/virtio_logs.h
index a1afb90a98..988514919f 100644
--- a/drivers/crypto/virtio/virtio_logs.h
+++ b/drivers/crypto/virtio/virtio_logs.h
@@ -21,14 +21,14 @@ extern int virtio_crypto_logtype_init;
 #define VIRTIO_CRYPTO_INIT_LOG_IMPL(level, ...) \
        RTE_LOG_LINE_PREFIX(level, VIRTIO_CRYPTO_INIT, "%s(): ", __func__, 
__VA_ARGS__)
 
-#define VIRTIO_CRYPTO_INIT_LOG_INFO(fmt, args...) \
-       VIRTIO_CRYPTO_INIT_LOG_IMPL(INFO, fmt, ## args)
+#define VIRTIO_CRYPTO_INIT_LOG_INFO(fmt, ...) \
+       VIRTIO_CRYPTO_INIT_LOG_IMPL(INFO, fmt, ## __VA_ARGS__)
 
-#define VIRTIO_CRYPTO_INIT_LOG_DBG(fmt, args...) \
-       VIRTIO_CRYPTO_INIT_LOG_IMPL(DEBUG, fmt, ## args)
+#define VIRTIO_CRYPTO_INIT_LOG_DBG(fmt, ...) \
+       VIRTIO_CRYPTO_INIT_LOG_IMPL(DEBUG, fmt, ## __VA_ARGS__)
 
-#define VIRTIO_CRYPTO_INIT_LOG_ERR(fmt, args...) \
-       VIRTIO_CRYPTO_INIT_LOG_IMPL(ERR, fmt, ## args)
+#define VIRTIO_CRYPTO_INIT_LOG_ERR(fmt, ...) \
+       VIRTIO_CRYPTO_INIT_LOG_IMPL(ERR, fmt, ## __VA_ARGS__)
 
 extern int virtio_crypto_logtype_session;
 #define RTE_LOGTYPE_VIRTIO_CRYPTO_SESSION virtio_crypto_logtype_session
@@ -36,14 +36,14 @@ extern int virtio_crypto_logtype_session;
 #define VIRTIO_CRYPTO_SESSION_LOG_IMPL(level, ...) \
        RTE_LOG_LINE_PREFIX(level, VIRTIO_CRYPTO_SESSION, "%s(): ", __func__, 
__VA_ARGS__)
 
-#define VIRTIO_CRYPTO_SESSION_LOG_INFO(fmt, args...) \
-       VIRTIO_CRYPTO_SESSION_LOG_IMPL(INFO, fmt, ## args)
+#define VIRTIO_CRYPTO_SESSION_LOG_INFO(fmt, ...) \
+       VIRTIO_CRYPTO_SESSION_LOG_IMPL(INFO, fmt, ## __VA_ARGS__)
 
-#define VIRTIO_CRYPTO_SESSION_LOG_DBG(fmt, args...) \
-       VIRTIO_CRYPTO_SESSION_LOG_IMPL(DEBUG, fmt, ## args)
+#define VIRTIO_CRYPTO_SESSION_LOG_DBG(fmt, ...) \
+       VIRTIO_CRYPTO_SESSION_LOG_IMPL(DEBUG, fmt, ## __VA_ARGS__)
 
-#define VIRTIO_CRYPTO_SESSION_LOG_ERR(fmt, args...) \
-       VIRTIO_CRYPTO_SESSION_LOG_IMPL(ERR, fmt, ## args)
+#define VIRTIO_CRYPTO_SESSION_LOG_ERR(fmt, ...) \
+       VIRTIO_CRYPTO_SESSION_LOG_IMPL(ERR, fmt, ## __VA_ARGS__)
 
 extern int virtio_crypto_logtype_rx;
 #define RTE_LOGTYPE_VIRTIO_CRYPTO_RX virtio_crypto_logtype_rx
@@ -51,14 +51,14 @@ extern int virtio_crypto_logtype_rx;
 #define VIRTIO_CRYPTO_RX_LOG_IMPL(level, ...) \
        RTE_LOG_LINE_PREFIX(level, VIRTIO_CRYPTO_RX, "%s(): ", __func__, 
__VA_ARGS__)
 
-#define VIRTIO_CRYPTO_RX_LOG_INFO(fmt, args...) \
-       VIRTIO_CRYPTO_RX_LOG_IMPL(INFO, fmt, ## args)
+#define VIRTIO_CRYPTO_RX_LOG_INFO(fmt, ...) \
+       VIRTIO_CRYPTO_RX_LOG_IMPL(INFO, fmt, ## __VA_ARGS__)
 
-#define VIRTIO_CRYPTO_RX_LOG_DBG(fmt, args...) \
-       VIRTIO_CRYPTO_RX_LOG_IMPL(DEBUG, fmt, ## args)
+#define VIRTIO_CRYPTO_RX_LOG_DBG(fmt, ...) \
+       VIRTIO_CRYPTO_RX_LOG_IMPL(DEBUG, fmt, ## __VA_ARGS__)
 
-#define VIRTIO_CRYPTO_RX_LOG_ERR(fmt, args...) \
-       VIRTIO_CRYPTO_RX_LOG_IMPL(ERR, fmt, ## args)
+#define VIRTIO_CRYPTO_RX_LOG_ERR(fmt, ...) \
+       VIRTIO_CRYPTO_RX_LOG_IMPL(ERR, fmt, ## __VA_ARGS__)
 
 extern int virtio_crypto_logtype_tx;
 #define RTE_LOGTYPE_VIRTIO_CRYPTO_TX virtio_crypto_logtype_tx
@@ -66,14 +66,14 @@ extern int virtio_crypto_logtype_tx;
 #define VIRTIO_CRYPTO_TX_LOG_IMPL(level, ...) \
        RTE_LOG_LINE_PREFIX(level, VIRTIO_CRYPTO_TX, "%s(): ", __func__, 
__VA_ARGS__)
 
-#define VIRTIO_CRYPTO_TX_LOG_INFO(fmt, args...) \
-       VIRTIO_CRYPTO_TX_LOG_IMPL(INFO, fmt, ## args)
+#define VIRTIO_CRYPTO_TX_LOG_INFO(fmt, ...) \
+       VIRTIO_CRYPTO_TX_LOG_IMPL(INFO, fmt, ## __VA_ARGS__)
 
-#define VIRTIO_CRYPTO_TX_LOG_DBG(fmt, args...) \
-       VIRTIO_CRYPTO_TX_LOG_IMPL(DEBUG, fmt, ## args)
+#define VIRTIO_CRYPTO_TX_LOG_DBG(fmt, ...) \
+       VIRTIO_CRYPTO_TX_LOG_IMPL(DEBUG, fmt, ## __VA_ARGS__)
 
-#define VIRTIO_CRYPTO_TX_LOG_ERR(fmt, args...) \
-       VIRTIO_CRYPTO_TX_LOG_IMPL(ERR, fmt, ## args)
+#define VIRTIO_CRYPTO_TX_LOG_ERR(fmt, ...) \
+       VIRTIO_CRYPTO_TX_LOG_IMPL(ERR, fmt, ## __VA_ARGS__)
 
 extern int virtio_crypto_logtype_driver;
 #define RTE_LOGTYPE_VIRTIO_CRYPTO_DRIVER virtio_crypto_logtype_driver
@@ -81,13 +81,13 @@ extern int virtio_crypto_logtype_driver;
 #define VIRTIO_CRYPTO_DRV_LOG_IMPL(level, ...) \
        RTE_LOG_LINE_PREFIX(level, VIRTIO_CRYPTO_DRIVER, "%s(): ", __func__, 
__VA_ARGS__)
 
-#define VIRTIO_CRYPTO_DRV_LOG_INFO(fmt, args...) \
-       VIRTIO_CRYPTO_DRV_LOG_IMPL(INFO, fmt, ## args)
+#define VIRTIO_CRYPTO_DRV_LOG_INFO(fmt, ...) \
+       VIRTIO_CRYPTO_DRV_LOG_IMPL(INFO, fmt, ## __VA_ARGS__)
 
-#define VIRTIO_CRYPTO_DRV_LOG_DBG(fmt, args...) \
-       VIRTIO_CRYPTO_DRV_LOG_IMPL(DEBUG, fmt, ## args)
+#define VIRTIO_CRYPTO_DRV_LOG_DBG(fmt, ...) \
+       VIRTIO_CRYPTO_DRV_LOG_IMPL(DEBUG, fmt, ## __VA_ARGS__)
 
-#define VIRTIO_CRYPTO_DRV_LOG_ERR(fmt, args...) \
-       VIRTIO_CRYPTO_DRV_LOG_IMPL(ERR, fmt, ## args)
+#define VIRTIO_CRYPTO_DRV_LOG_ERR(fmt, ...) \
+       VIRTIO_CRYPTO_DRV_LOG_IMPL(ERR, fmt, ## __VA_ARGS__)
 
 #endif /* _VIRTIO_LOGS_H_ */
-- 
2.47.0.vfs.0.3

Reply via email to