From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id DCFD745E7C;
	Wed, 11 Dec 2024 23:08:17 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 6FBB54065C;
	Wed, 11 Dec 2024 23:07:42 +0100 (CET)
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
 by mails.dpdk.org (Postfix) with ESMTP id D129A40263
 for <dev@dpdk.org>; Wed, 11 Dec 2024 23:07:33 +0100 (CET)
Received: by linux.microsoft.com (Postfix, from userid 1213)
 id A7D76204723E; Wed, 11 Dec 2024 14:07:32 -0800 (PST)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A7D76204723E
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
 s=default; t=1733954852;
 bh=EUta7k8RQ6URjhNjcpp4ikIhgKLOoz67FdtbhndVMI0=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=KtCpNasmJ2IAe0ZsTVYnyrnoaT2H/rzk9Uvokvk8/MfNJSXL6IeVng48kpALUUl2H
 f71kmbXQi8iDA6SN+SsG2v4xIF75We/VFfND2bbtXjzQ8VGo19gvn5EkfEahLAe6Wu
 fMnPfYmPJ8Kf69xHhDPXfL6A0U5XbkDocfhlN8ec=
From: Andre Muezerie <andremue@linux.microsoft.com>
To: dev@dpdk.org
Cc: Andre Muezerie <andremue@linux.microsoft.com>
Subject: [PATCH v2 11/14] drivers/mempool: use portable variadic macros
Date: Wed, 11 Dec 2024 14:07:21 -0800
Message-Id: <1733954844-24397-12-git-send-email-andremue@linux.microsoft.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1733954844-24397-1-git-send-email-andremue@linux.microsoft.com>
References: <1733882751-29598-1-git-send-email-andremue@linux.microsoft.com>
 <1733954844-24397-1-git-send-email-andremue@linux.microsoft.com>
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

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 <andremue@linux.microsoft.com>
---
 drivers/mempool/dpaa/dpaa_mempool.h           | 20 ++++++-------
 drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h | 30 +++++++++----------
 2 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h
index 135520922f..0877068fdd 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.h
+++ b/drivers/mempool/dpaa/dpaa_mempool.h
@@ -65,15 +65,15 @@ extern struct dpaa_bp_info *rte_dpaa_bpid_info;
 
 #define MEMPOOL_INIT_FUNC_TRACE() DPAA_MEMPOOL_LOG(DEBUG, " >>")
 
-#define DPAA_MEMPOOL_DPDEBUG(fmt, args...) \
-	RTE_LOG_DP(DEBUG, DPAA_MEMPOOL, fmt, ## args)
-#define DPAA_MEMPOOL_DEBUG(fmt, args...) \
-	DPAA_MEMPOOL_LOG(DEBUG, fmt, ## args)
-#define DPAA_MEMPOOL_ERR(fmt, args...) \
-	DPAA_MEMPOOL_LOG(ERR, fmt, ## args)
-#define DPAA_MEMPOOL_INFO(fmt, args...) \
-	DPAA_MEMPOOL_LOG(INFO, fmt, ## args)
-#define DPAA_MEMPOOL_WARN(fmt, args...) \
-	DPAA_MEMPOOL_LOG(WARNING, fmt, ## args)
+#define DPAA_MEMPOOL_DPDEBUG(fmt, ...) \
+	RTE_LOG_DP(DEBUG, DPAA_MEMPOOL, fmt, ## __VA_ARGS__)
+#define DPAA_MEMPOOL_DEBUG(fmt, ...) \
+	DPAA_MEMPOOL_LOG(DEBUG, fmt, ## __VA_ARGS__)
+#define DPAA_MEMPOOL_ERR(fmt, ...) \
+	DPAA_MEMPOOL_LOG(ERR, fmt, ## __VA_ARGS__)
+#define DPAA_MEMPOOL_INFO(fmt, ...) \
+	DPAA_MEMPOOL_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA_MEMPOOL_WARN(fmt, ...) \
+	DPAA_MEMPOOL_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 #endif
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
index d69ef17a04..1ba7983206 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
@@ -15,22 +15,22 @@ extern int dpaa2_logtype_mempool;
 #define DPAA2_MEMPOOL_DEBUG(...) \
 	RTE_LOG_LINE_PREFIX(DEBUG, DPAA2_MEMPOOL, "%s(): ", __func__, __VA_ARGS__)
 
-#define DPAA2_MEMPOOL_INFO(fmt, args...) \
-	DPAA2_MEMPOOL_LOG(INFO, fmt, ## args)
-#define DPAA2_MEMPOOL_ERR(fmt, args...) \
-	DPAA2_MEMPOOL_LOG(ERR, fmt, ## args)
-#define DPAA2_MEMPOOL_WARN(fmt, args...) \
-	DPAA2_MEMPOOL_LOG(WARNING, fmt, ## args)
+#define DPAA2_MEMPOOL_INFO(fmt, ...) \
+	DPAA2_MEMPOOL_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA2_MEMPOOL_ERR(fmt, ...) \
+	DPAA2_MEMPOOL_LOG(ERR, fmt, ## __VA_ARGS__)
+#define DPAA2_MEMPOOL_WARN(fmt, ...) \
+	DPAA2_MEMPOOL_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 /* DP Logs, toggled out at compile time if level lower than current level */
-#define DPAA2_MEMPOOL_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, DPAA2_MEMPOOL, fmt, ## args)
-
-#define DPAA2_MEMPOOL_DP_DEBUG(fmt, args...) \
-	DPAA2_MEMPOOL_DP_LOG(DEBUG, fmt, ## args)
-#define DPAA2_MEMPOOL_DP_INFO(fmt, args...) \
-	DPAA2_MEMPOOL_DP_LOG(INFO, fmt, ## args)
-#define DPAA2_MEMPOOL_DP_WARN(fmt, args...) \
-	DPAA2_MEMPOOL_DP_LOG(WARNING, fmt, ## args)
+#define DPAA2_MEMPOOL_DP_LOG(level, fmt, ...) \
+	RTE_LOG_DP(level, DPAA2_MEMPOOL, fmt, ## __VA_ARGS__)
+
+#define DPAA2_MEMPOOL_DP_DEBUG(fmt, ...) \
+	DPAA2_MEMPOOL_DP_LOG(DEBUG, fmt, ## __VA_ARGS__)
+#define DPAA2_MEMPOOL_DP_INFO(fmt, ...) \
+	DPAA2_MEMPOOL_DP_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA2_MEMPOOL_DP_WARN(fmt, ...) \
+	DPAA2_MEMPOOL_DP_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 #endif /* _DPAA2_HW_MEMPOOL_LOGS_H_ */
-- 
2.47.0.vfs.0.3