From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
To: dev@dpdk.org
Cc: satishr@chelsio.com, indranil@chelsio.com
Subject: [dpdk-dev] [PATCH 2/4] net/cxgbe: fix macros related to logs for Windows
Date: Thu, 13 Dec 2018 20:32:11 +0530 [thread overview]
Message-ID: <1544713333-32239-3-git-send-email-rahul.lakkireddy@chelsio.com> (raw)
In-Reply-To: <1544713333-32239-1-git-send-email-rahul.lakkireddy@chelsio.com>
Replace "args..." with "fmt, ..." and directly use __VA_ARGS__.
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
drivers/net/cxgbe/cxgbe_compat.h | 40 ++++++++++++++++++--------------
1 file changed, 22 insertions(+), 18 deletions(-)
diff --git a/drivers/net/cxgbe/cxgbe_compat.h b/drivers/net/cxgbe/cxgbe_compat.h
index 5d47c5f3d..ce4662d54 100644
--- a/drivers/net/cxgbe/cxgbe_compat.h
+++ b/drivers/net/cxgbe/cxgbe_compat.h
@@ -19,41 +19,45 @@
#include <rte_log.h>
#include <rte_io.h>
-#define dev_printf(level, fmt, args...) \
- RTE_LOG(level, PMD, "rte_cxgbe_pmd: " fmt, ## args)
+#define dev_printf(level, fmt, ...) \
+ RTE_LOG(level, PMD, "rte_cxgbe_pmd: " fmt, ##__VA_ARGS__)
-#define dev_err(x, args...) dev_printf(ERR, args)
-#define dev_info(x, args...) dev_printf(INFO, args)
-#define dev_warn(x, args...) dev_printf(WARNING, args)
+#define dev_err(x, fmt, ...) dev_printf(ERR, fmt, ##__VA_ARGS__)
+#define dev_info(x, fmt, ...) dev_printf(INFO, fmt, ##__VA_ARGS__)
+#define dev_warn(x, fmt, ...) dev_printf(WARNING, fmt, ##__VA_ARGS__)
#ifdef RTE_LIBRTE_CXGBE_DEBUG
-#define dev_debug(x, args...) dev_printf(DEBUG, args)
+#define dev_debug(x, fmt, ...) dev_printf(INFO, fmt, ##__VA_ARGS__)
#else
-#define dev_debug(x, args...) do { } while (0)
+#define dev_debug(x, fmt, ...) do { } while (0)
#endif
#ifdef RTE_LIBRTE_CXGBE_DEBUG_REG
-#define CXGBE_DEBUG_REG(x, args...) dev_printf(DEBUG, "REG:" args)
+#define CXGBE_DEBUG_REG(x, fmt, ...) \
+ dev_printf(INFO, "REG:" fmt, ##__VA_ARGS__)
#else
-#define CXGBE_DEBUG_REG(x, args...) do { } while (0)
+#define CXGBE_DEBUG_REG(x, fmt, ...) do { } while (0)
#endif
#ifdef RTE_LIBRTE_CXGBE_DEBUG_MBOX
-#define CXGBE_DEBUG_MBOX(x, args...) dev_printf(DEBUG, "MBOX:" args)
+#define CXGBE_DEBUG_MBOX(x, fmt, ...) \
+ dev_printf(INFO, "MBOX:" fmt, ##__VA_ARGS__)
#else
-#define CXGBE_DEBUG_MBOX(x, args...) do { } while (0)
+#define CXGBE_DEBUG_MBOX(x, fmt, ...) do { } while (0)
#endif
#ifdef RTE_LIBRTE_CXGBE_DEBUG_TX
-#define CXGBE_DEBUG_TX(x, args...) dev_printf(DEBUG, "TX:" args)
+#define CXGBE_DEBUG_TX(x, fmt, ...) \
+ dev_printf(INFO, "TX:" fmt, ##__VA_ARGS__)
#else
-#define CXGBE_DEBUG_TX(x, args...) do { } while (0)
+#define CXGBE_DEBUG_TX(x, fmt, ...) do { } while (0)
#endif
#ifdef RTE_LIBRTE_CXGBE_DEBUG_RX
-#define CXGBE_DEBUG_RX(x, args...) dev_printf(DEBUG, "RX:" args)
+#define CXGBE_DEBUG_RX(x, fmt, ...) \
+ dev_printf(INFO, "RX:" fmt, ##__VA_ARGS__)
#else
-#define CXGBE_DEBUG_RX(x, args...) do { } while (0)
+#define CXGBE_DEBUG_RX(x, fmt, ...) do { } while (0)
#endif
#ifdef RTE_LIBRTE_CXGBE_DEBUG
@@ -63,9 +67,9 @@
#define CXGBE_FUNC_TRACE() do { } while (0)
#endif
-#define pr_err(y, args...) dev_err(0, y, ##args)
-#define pr_warn(y, args...) dev_warn(0, y, ##args)
-#define pr_info(y, args...) dev_info(0, y, ##args)
+#define pr_err(fmt, ...) dev_err(0, fmt, ##__VA_ARGS__)
+#define pr_warn(fmt, ...) dev_warn(0, fmt, ##__VA_ARGS__)
+#define pr_info(fmt, ...) dev_info(0, fmt, ##__VA_ARGS__)
#define BUG() pr_err("BUG at %s:%d", __func__, __LINE__)
#define ASSERT(x) do {\
--
2.18.0
next prev parent reply other threads:[~2018-12-13 15:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-13 15:02 [dpdk-dev] [PATCH 0/4] net/cxgbe: fix build for Microsoft Windows OS support Rahul Lakkireddy
2018-12-13 15:02 ` [dpdk-dev] [PATCH 1/4] net/cxgbe: use relative paths for including header files Rahul Lakkireddy
2018-12-18 18:23 ` Ferruh Yigit
2018-12-19 12:42 ` Rahul Lakkireddy
2018-12-13 15:02 ` Rahul Lakkireddy [this message]
2018-12-18 18:25 ` [dpdk-dev] [PATCH 2/4] net/cxgbe: fix macros related to logs for Windows Ferruh Yigit
2018-12-19 12:39 ` Rahul Lakkireddy
2018-12-19 13:45 ` Ferruh Yigit
2018-12-19 14:11 ` Rahul Lakkireddy
2018-12-13 15:02 ` [dpdk-dev] [PATCH 3/4] net/cxgbe: only redefine symbols when not available " Rahul Lakkireddy
2018-12-18 18:26 ` Ferruh Yigit
2018-12-19 12:41 ` Rahul Lakkireddy
2018-12-13 15:02 ` [dpdk-dev] [PATCH 4/4] net/cxgbe: fix other misc build issues " Rahul Lakkireddy
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=1544713333-32239-3-git-send-email-rahul.lakkireddy@chelsio.com \
--to=rahul.lakkireddy@chelsio.com \
--cc=dev@dpdk.org \
--cc=indranil@chelsio.com \
--cc=satishr@chelsio.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).