dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Andre Muezerie <andremue@linux.microsoft.com>
To: dev@dpdk.org
Cc: Andre Muezerie <andremue@linux.microsoft.com>
Subject: [PATCH v2 10/14] drivers/event: use portable variadic macros
Date: Wed, 11 Dec 2024 14:07:20 -0800	[thread overview]
Message-ID: <1733954844-24397-11-git-send-email-andremue@linux.microsoft.com> (raw)
In-Reply-To: <1733954844-24397-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/event/dlb2/dlb2_log.h             |  8 ++++----
 drivers/event/dlb2/pf/base/dlb2_osdep.h   | 12 ++++++------
 drivers/event/dpaa/dpaa_eventdev.h        | 16 ++++++++--------
 drivers/event/dpaa2/dpaa2_eventdev_logs.h | 12 ++++++------
 drivers/event/dsw/dsw_evdev.h             |  8 ++++----
 drivers/event/sw/sw_evdev_log.h           | 12 ++++++------
 6 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/drivers/event/dlb2/dlb2_log.h b/drivers/event/dlb2/dlb2_log.h
index c9ce87681c..321ecdfd05 100644
--- a/drivers/event/dlb2/dlb2_log.h
+++ b/drivers/event/dlb2/dlb2_log.h
@@ -12,11 +12,11 @@ extern int eventdev_dlb2_log_level;
 #define DLB2_LOG_IMPL(level, ...) \
 	RTE_LOG_LINE_PREFIX(level, EVENTDEV_DLB2, "%s", __func__, __VA_ARGS__)
 
-#define DLB2_LOG_INFO(fmt, args...) \
-	DLB2_LOG_IMPL(INFO, fmt, ## args)
+#define DLB2_LOG_INFO(fmt, ...) \
+	DLB2_LOG_IMPL(INFO, fmt, ## __VA_ARGS__)
 
-#define DLB2_LOG_ERR(fmt, args...) \
-	DLB2_LOG_IMPL(ERR, fmt, ## args)
+#define DLB2_LOG_ERR(fmt, ...) \
+	DLB2_LOG_IMPL(ERR, fmt, ## __VA_ARGS__)
 
 /* remove debug logs at compile time unless actually debugging */
 #define DLB2_LOG_LINE_DBG(...) \
diff --git a/drivers/event/dlb2/pf/base/dlb2_osdep.h b/drivers/event/dlb2/pf/base/dlb2_osdep.h
index 16c5e3b797..382a49090a 100644
--- a/drivers/event/dlb2/pf/base/dlb2_osdep.h
+++ b/drivers/event/dlb2/pf/base/dlb2_osdep.h
@@ -40,14 +40,14 @@
 	DLB2_PCI_REG_WRITE(DLB2_FUNC_REG_ADDR((hw), (reg)), (value))
 
 /* Map to PMDs logging interface */
-#define DLB2_ERR(dev, fmt, args...) \
-	RTE_LOG(ERR, EVENTDEV_DLB2, "%s" fmt, __func__, ## args)
+#define DLB2_ERR(dev, fmt, ...) \
+	RTE_LOG(ERR, EVENTDEV_DLB2, "%s" fmt, __func__, ## __VA_ARGS__)
 
-#define DLB2_INFO(dev, fmt, args...) \
-	RTE_LOG(INFO, EVENTDEV_DLB2, "%s" fmt, __func__, ## args)
+#define DLB2_INFO(dev, fmt, ...) \
+	RTE_LOG(INFO, EVENTDEV_DLB2, "%s" fmt, __func__, ## __VA_ARGS__)
 
-#define DLB2_DEBUG(dev, fmt, args...) \
-	RTE_LOG_DP(DEBUG, EVENTDEV_DLB2, fmt, ## args)
+#define DLB2_DEBUG(dev, fmt, ...) \
+	RTE_LOG_DP(DEBUG, EVENTDEV_DLB2, fmt, ## __VA_ARGS__)
 
 /**
  * os_udelay() - busy-wait for a number of microseconds
diff --git a/drivers/event/dpaa/dpaa_eventdev.h b/drivers/event/dpaa/dpaa_eventdev.h
index 5831ccb4e8..047c9781bd 100644
--- a/drivers/event/dpaa/dpaa_eventdev.h
+++ b/drivers/event/dpaa/dpaa_eventdev.h
@@ -82,13 +82,13 @@ struct dpaa_eventdev {
 
 #define EVENTDEV_INIT_FUNC_TRACE() DPAA_EVENTDEV_LOG(DEBUG, " >>")
 
-#define DPAA_EVENTDEV_DEBUG(fmt, args...) \
-	DPAA_EVENTDEV_LOG(DEBUG, fmt, ## args)
-#define DPAA_EVENTDEV_ERR(fmt, args...) \
-	DPAA_EVENTDEV_LOG(ERR, fmt, ## args)
-#define DPAA_EVENTDEV_INFO(fmt, args...) \
-	DPAA_EVENTDEV_LOG(INFO, fmt, ## args)
-#define DPAA_EVENTDEV_WARN(fmt, args...) \
-	DPAA_EVENTDEV_LOG(WARNING, fmt, ## args)
+#define DPAA_EVENTDEV_DEBUG(fmt, ...) \
+	DPAA_EVENTDEV_LOG(DEBUG, fmt, ## __VA_ARGS__)
+#define DPAA_EVENTDEV_ERR(fmt, ...) \
+	DPAA_EVENTDEV_LOG(ERR, fmt, ## __VA_ARGS__)
+#define DPAA_EVENTDEV_INFO(fmt, ...) \
+	DPAA_EVENTDEV_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA_EVENTDEV_WARN(fmt, ...) \
+	DPAA_EVENTDEV_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 #endif /* __DPAA_EVENTDEV_H__ */
diff --git a/drivers/event/dpaa2/dpaa2_eventdev_logs.h b/drivers/event/dpaa2/dpaa2_eventdev_logs.h
index 12317ae39f..7145ac30b9 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev_logs.h
+++ b/drivers/event/dpaa2/dpaa2_eventdev_logs.h
@@ -16,12 +16,12 @@ extern int dpaa2_logtype_event;
 
 #define EVENTDEV_INIT_FUNC_TRACE() DPAA2_EVENTDEV_DEBUG(" >>")
 
-#define DPAA2_EVENTDEV_INFO(fmt, args...) \
-	DPAA2_EVENTDEV_LOG(INFO, fmt, ## args)
-#define DPAA2_EVENTDEV_ERR(fmt, args...) \
-	DPAA2_EVENTDEV_LOG(ERR, fmt, ## args)
-#define DPAA2_EVENTDEV_WARN(fmt, args...) \
-	DPAA2_EVENTDEV_LOG(WARNING, fmt, ## args)
+#define DPAA2_EVENTDEV_INFO(fmt, ...) \
+	DPAA2_EVENTDEV_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA2_EVENTDEV_ERR(fmt, ...) \
+	DPAA2_EVENTDEV_LOG(ERR, fmt, ## __VA_ARGS__)
+#define DPAA2_EVENTDEV_WARN(fmt, ...) \
+	DPAA2_EVENTDEV_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 #define dpaa2_evdev_info(fmt, ...) DPAA2_EVENTDEV_LOG(INFO, fmt, ##__VA_ARGS__)
 #define dpaa2_evdev_dbg(fmt, ...) DPAA2_EVENTDEV_LOG(DEBUG, fmt, ##__VA_ARGS__)
diff --git a/drivers/event/dsw/dsw_evdev.h b/drivers/event/dsw/dsw_evdev.h
index ce52498435..6b75bb13e3 100644
--- a/drivers/event/dsw/dsw_evdev.h
+++ b/drivers/event/dsw/dsw_evdev.h
@@ -303,11 +303,11 @@ dsw_pmd_priv(const struct rte_eventdev *eventdev)
 
 extern int event_dsw_logtype;
 #define RTE_LOGTYPE_EVENT_DSW event_dsw_logtype
-#define DSW_LOG_DP_LINE(level, fmt, args...)				\
+#define DSW_LOG_DP_LINE(level, fmt, ...)				\
 	RTE_LOG_DP_LINE(level, EVENT_DSW, "%s() line %u: " fmt,		\
-		   __func__, __LINE__, ## args)
+		   __func__, __LINE__, ## __VA_ARGS__)
 
-#define DSW_LOG_DP_PORT_LINE(level, port_id, fmt, args...)		\
-	DSW_LOG_DP_LINE(level, "<Port %d> " fmt, port_id, ## args)
+#define DSW_LOG_DP_PORT_LINE(level, port_id, fmt, ...)		\
+	DSW_LOG_DP_LINE(level, "<Port %d> " fmt, port_id, ## __VA_ARGS__)
 
 #endif
diff --git a/drivers/event/sw/sw_evdev_log.h b/drivers/event/sw/sw_evdev_log.h
index 50a707939c..68c18b3d07 100644
--- a/drivers/event/sw/sw_evdev_log.h
+++ b/drivers/event/sw/sw_evdev_log.h
@@ -11,13 +11,13 @@ extern int eventdev_sw_log_level;
 #define SW_LOG_IMPL(level, ...) \
 	RTE_LOG_LINE_PREFIX(level, EVENT_SW, "%s", __func__, __VA_ARGS__)
 
-#define SW_LOG_INFO(fmt, args...) \
-	SW_LOG_IMPL(INFO, fmt, ## args)
+#define SW_LOG_INFO(fmt, ...) \
+	SW_LOG_IMPL(INFO, fmt, ## __VA_ARGS__)
 
-#define SW_LOG_DBG(fmt, args...) \
-	SW_LOG_IMPL(DEBUG, fmt, ## args)
+#define SW_LOG_DBG(fmt, ...) \
+	SW_LOG_IMPL(DEBUG, fmt, ## __VA_ARGS__)
 
-#define SW_LOG_ERR(fmt, args...) \
-	SW_LOG_IMPL(ERR, fmt, ## args)
+#define SW_LOG_ERR(fmt, ...) \
+	SW_LOG_IMPL(ERR, fmt, ## __VA_ARGS__)
 
 #endif /* _SW_EVDEV_LOG_H_ */
-- 
2.47.0.vfs.0.3


  parent reply	other threads:[~2024-12-11 22:08 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 ` [PATCH 08/21] drivers/compress: " Andre Muezerie
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   ` Andre Muezerie [this message]
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=1733954844-24397-11-git-send-email-andremue@linux.microsoft.com \
    --to=andremue@linux.microsoft.com \
    --cc=dev@dpdk.org \
    /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).