dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Andre Muezerie <andremue@linux.microsoft.com>
To: Ashish Gupta <ashish.gupta@marvell.com>,
	Fan Zhang <fanzhang.oss@gmail.com>,
	Sunila Sahu <ssahu@marvell.com>
Cc: dev@dpdk.org, Andre Muezerie <andremue@linux.microsoft.com>
Subject: [PATCH 08/21] drivers/compress: use portable variadic macros
Date: Tue, 10 Dec 2024 18:05:38 -0800	[thread overview]
Message-ID: <1733882751-29598-9-git-send-email-andremue@linux.microsoft.com> (raw)
In-Reply-To: <1733882751-29598-1-git-send-email-andremue@linux.microsoft.com>

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/compress/octeontx/otx_zip.h      |  8 ++++----
 drivers/compress/zlib/zlib_pmd_private.h | 12 ++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/compress/octeontx/otx_zip.h b/drivers/compress/octeontx/otx_zip.h
index bf09e2f58c..6265664ead 100644
--- a/drivers/compress/octeontx/otx_zip.h
+++ b/drivers/compress/octeontx/otx_zip.h
@@ -80,10 +80,10 @@ extern int octtx_zip_logtype_driver;
 #define ZIP_PMD_LOG(level, ...) \
 	RTE_LOG_LINE_PREFIX(level, OCTTX_ZIP_DRIVER, "%s(): ", __func__, __VA_ARGS__)
 
-#define ZIP_PMD_INFO(fmt, args...) \
-	ZIP_PMD_LOG(INFO, fmt, ## args)
-#define ZIP_PMD_ERR(fmt, args...) \
-	ZIP_PMD_LOG(ERR, fmt, ## args)
+#define ZIP_PMD_INFO(fmt, ...) \
+	ZIP_PMD_LOG(INFO, fmt, ## __VA_ARGS__)
+#define ZIP_PMD_ERR(fmt, ...) \
+	ZIP_PMD_LOG(ERR, fmt, ## __VA_ARGS__)
 
 /* resources required to process stream */
 enum NUM_BUFS_PER_STREAM {
diff --git a/drivers/compress/zlib/zlib_pmd_private.h b/drivers/compress/zlib/zlib_pmd_private.h
index 7f6a57c6c5..fd8c4c55a4 100644
--- a/drivers/compress/zlib/zlib_pmd_private.h
+++ b/drivers/compress/zlib/zlib_pmd_private.h
@@ -19,12 +19,12 @@ extern int zlib_logtype_driver;
 #define ZLIB_PMD_LOG(level, ...) \
 	RTE_LOG_LINE_PREFIX(level, ZLIB_DRIVER, "%s(): ", __func__, __VA_ARGS__)
 
-#define ZLIB_PMD_INFO(fmt, args...) \
-	ZLIB_PMD_LOG(INFO, fmt, ## args)
-#define ZLIB_PMD_ERR(fmt, args...) \
-	ZLIB_PMD_LOG(ERR, fmt, ## args)
-#define ZLIB_PMD_WARN(fmt, args...) \
-	ZLIB_PMD_LOG(WARNING, fmt, ## args)
+#define ZLIB_PMD_INFO(fmt, ...) \
+	ZLIB_PMD_LOG(INFO, fmt, ## __VA_ARGS__)
+#define ZLIB_PMD_ERR(fmt, ...) \
+	ZLIB_PMD_LOG(ERR, fmt, ## __VA_ARGS__)
+#define ZLIB_PMD_WARN(fmt, ...) \
+	ZLIB_PMD_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 struct zlib_private {
 	struct rte_mempool *mp;
-- 
2.47.0.vfs.0.3


  parent reply	other threads:[~2024-12-11  2:07 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-11  2:05 [PATCH 00/21] use portable variadic macros Andre Muezerie
2024-12-11  2:05 ` [PATCH 01/21] app/test-acl: " Andre Muezerie
2024-12-11  2:05 ` [PATCH 02/21] app/test-eventdev: " Andre Muezerie
2024-12-11  2:05 ` [PATCH 03/21] app/test-mldev: " Andre Muezerie
2024-12-11  2:05 ` [PATCH 04/21] app/test-pmd: " Andre Muezerie
2024-12-11  2:05 ` [PATCH 05/21] drivers/baseband: ensure code structure does not change Andre Muezerie
2024-12-11  2:05 ` [PATCH 06/21] drivers/bus: use portable variadic macros Andre Muezerie
2024-12-11  2:05 ` [PATCH 07/21] drivers/common: " Andre Muezerie
2024-12-11  2:05 ` Andre Muezerie [this message]
2024-12-11  2:05 ` [PATCH 09/21] drivers/crypto: " Andre Muezerie
2024-12-11  2:05 ` [PATCH 10/21] drivers/dma: " Andre Muezerie
2024-12-11  2:05 ` [PATCH 11/21] drivers/event: " Andre Muezerie
2024-12-11  2:05 ` [PATCH 12/21] drivers/mempool: " Andre Muezerie
2024-12-11  2:05 ` [PATCH 13/21] drivers/net: " Andre Muezerie
2024-12-16  9:02   ` Andrew Rybchenko
2024-12-11  2:05 ` [PATCH 14/21] drivers/raw: " Andre Muezerie
2024-12-11  2:05 ` [PATCH 15/21] drivers/vdpa: " Andre Muezerie
2024-12-11  2:05 ` [PATCH 16/21] lib/log: ensure code structure does not change Andre Muezerie
2024-12-11  3:13   ` Stephen Hemminger
2024-12-11 16:16     ` Andre Muezerie
2024-12-11  2:05 ` [PATCH 17/21] lib/pipeline: " Andre Muezerie
2024-12-11  2:05 ` [PATCH 18/21] lib/port: " Andre Muezerie
2024-12-11  2:05 ` [PATCH 19/21] lib/power: " Andre Muezerie
2024-12-11  2:05 ` [PATCH 20/21] lib/rcu: " Andre Muezerie
2024-12-11  2:05 ` [PATCH 21/21] lib/vhost: " Andre Muezerie
2024-12-11  3:14 ` [PATCH 00/21] use portable variadic macros Stephen Hemminger
2024-12-11 21:35   ` Andre Muezerie
2024-12-11 22:07 ` [PATCH v2 00/14] " Andre Muezerie
2024-12-11 22:07   ` [PATCH v2 01/14] app/test-acl: " Andre Muezerie
2024-12-11 22:07   ` [PATCH v2 02/14] app/test-eventdev: " Andre Muezerie
2024-12-11 22:07   ` [PATCH v2 03/14] app/test-mldev: " Andre Muezerie
2024-12-11 22:07   ` [PATCH v2 04/14] app/test-pmd: " Andre Muezerie
2024-12-11 22:07   ` [PATCH v2 05/14] drivers/bus: " Andre Muezerie
2024-12-23  8:43     ` David Marchand
2024-12-11 22:07   ` [PATCH v2 06/14] drivers/common: " Andre Muezerie
2024-12-11 22:07   ` [PATCH v2 07/14] drivers/compress: " Andre Muezerie
2024-12-11 22:07   ` [PATCH v2 08/14] drivers/crypto: " Andre Muezerie
2024-12-11 22:07   ` [PATCH v2 09/14] drivers/dma: " Andre Muezerie
2024-12-11 22:07   ` [PATCH v2 10/14] drivers/event: " Andre Muezerie
2024-12-11 22:07   ` [PATCH v2 11/14] drivers/mempool: " Andre Muezerie
2024-12-11 22:07   ` [PATCH v2 12/14] drivers/net: " Andre Muezerie
2024-12-11 22:07   ` [PATCH v2 13/14] drivers/raw: " Andre Muezerie
2024-12-23  8:45     ` David Marchand
2024-12-11 22:07   ` [PATCH v2 14/14] drivers/vdpa: " Andre Muezerie
2024-12-23  9:28   ` [PATCH v2 00/14] " David Marchand
2024-12-23 15:39     ` Andre Muezerie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1733882751-29598-9-git-send-email-andremue@linux.microsoft.com \
    --to=andremue@linux.microsoft.com \
    --cc=ashish.gupta@marvell.com \
    --cc=dev@dpdk.org \
    --cc=fanzhang.oss@gmail.com \
    --cc=ssahu@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).