From patchwork Mon Feb 12 21:49:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 136617 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B1C0B43AFE; Mon, 12 Feb 2024 22:50:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5057841140; Mon, 12 Feb 2024 22:49:40 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 448F440E36 for ; Mon, 12 Feb 2024 22:49:24 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 0B90920B200F; Mon, 12 Feb 2024 13:49:22 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0B90920B200F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1707774563; bh=KKaB/DL9OZoncT9X5DBVsRHKm3WAFuyserzgF20yKXg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i1l6rZcrp6IKd1ixChj8EUszWwVrSoUICs9pP39/LNHUTow6XSob9UzdSjdsZENoE z1ds/FTXOLpiFN6+i8kg+8NbK0NF05jMALFT4pg6f0jYdRCywDsYFw5RgcqpuWCp77 uATmAoQAt8PL8HPXj7pAASjhpzV7CBomdl4qlPlw= From: Tyler Retzlaff To: dev@dpdk.org Cc: Anatoly Burakov , Ashish Gupta , Chenbo Xia , Cristian Dumitrescu , David Hunt , Fan Zhang , Hemant Agrawal , Honnappa Nagarahalli , Jasvinder Singh , Jerin Jacob , Konstantin Ananyev , Maxime Coquelin , Reshma Pattan , Sachin Saxena , Sivaprasad Tummala , Srikanth Yalavarthi , Stephen Hemminger , Sunil Kumar Kori , Tyler Retzlaff Subject: [PATCH 15/15] vhost: use GCC and MSVC common VA ARGS extension Date: Mon, 12 Feb 2024 13:49:17 -0800 Message-Id: <1707774557-16012-16-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707774557-16012-1-git-send-email-roretzla@linux.microsoft.com> References: <1707774557-16012-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Use ... and forward with __VA_ARGS__ instead of args... and args. Neither mechanism is conformant with the standard but the former works with both GCC and MSVC. Signed-off-by: Tyler Retzlaff --- lib/vhost/vhost.h | 8 ++++---- lib/vhost/vhost_crypto.c | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h index 0b13374..b539d6c 100644 --- a/lib/vhost/vhost.h +++ b/lib/vhost/vhost.h @@ -677,11 +677,11 @@ void __vhost_log_write_iova(struct virtio_net *dev, struct vhost_virtqueue *vq, extern int vhost_data_log_level; #define RTE_LOGTYPE_VHOST_DATA vhost_data_log_level -#define VHOST_CONFIG_LOG(prefix, level, fmt, args...) \ - RTE_LOG_LINE(level, VHOST_CONFIG, "(%s) " fmt, prefix, ##args) +#define VHOST_CONFIG_LOG(prefix, level, fmt, ...) \ + RTE_LOG_LINE(level, VHOST_CONFIG, "(%s) " fmt, prefix, ## __VA_ARGS__) -#define VHOST_DATA_LOG(prefix, level, fmt, args...) \ - RTE_LOG_DP_LINE(level, VHOST_DATA, "(%s) " fmt, prefix, ##args) +#define VHOST_DATA_LOG(prefix, level, fmt, ...) \ + RTE_LOG_DP_LINE(level, VHOST_DATA, "(%s) " fmt, prefix, ## __VA_ARGS__) #ifdef RTE_LIBRTE_VHOST_DEBUG #define VHOST_MAX_PRINT_BUFF 6072 diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c index 3704fbb..86983c1 100644 --- a/lib/vhost/vhost_crypto.c +++ b/lib/vhost/vhost_crypto.c @@ -20,19 +20,19 @@ RTE_LOG_REGISTER_SUFFIX(vhost_crypto_logtype, crypto, INFO); #define RTE_LOGTYPE_VHOST_CRYPTO vhost_crypto_logtype -#define VC_LOG_ERR(fmt, args...) \ +#define VC_LOG_ERR(fmt, ...) \ RTE_LOG_LINE(ERR, VHOST_CRYPTO, "%s() line %u: " fmt, \ - __func__, __LINE__, ## args) -#define VC_LOG_INFO(fmt, args...) \ + __func__, __LINE__, ## __VA_ARGS__) +#define VC_LOG_INFO(fmt, ...) \ RTE_LOG_LINE(INFO, VHOST_CRYPTO, "%s() line %u: " fmt, \ - __func__, __LINE__, ## args) + __func__, __LINE__, ## __VA_ARGS__) #ifdef RTE_LIBRTE_VHOST_DEBUG -#define VC_LOG_DBG(fmt, args...) \ +#define VC_LOG_DBG(fmt, ...) \ RTE_LOG_LINE(DEBUG, VHOST_CRYPTO, "%s() line %u: " fmt, \ - __func__, __LINE__, ## args) + __func__, __LINE__, ## __VA_ARGS__) #else -#define VC_LOG_DBG(fmt, args...) +#define VC_LOG_DBG(fmt, ...) #endif #define VIRTIO_CRYPTO_FEATURES ((1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) | \