From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6186DA0548; Sun, 28 Feb 2021 13:55:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B5C6822A2D4; Sun, 28 Feb 2021 13:54:22 +0100 (CET) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id DCA2922A2C3 for ; Sun, 28 Feb 2021 13:54:21 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id D6DBD5D4; Sun, 28 Feb 2021 07:54:20 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=G1oqJfYuTS5fo +2YaxQNIcDkIeLpWlAW0XoBux5ubVE=; b=tP4hzNQ8U/l/7BRmREO0KMp3kx2Ba WPmm0tQ8KdE9dasJRnCxOjWxYFbWuAgByB6BaLfd01mvoB4T3J+Wnv+AfZmrwd6S SOtAGU10gAOGbP8BXNybGCalLU0DYNsibidRMEKh27amx+ZrJGpUbmVKNgf0sHS8 jIL0zxy6s7vWS2YkVaDisk/f3Tue7AhhvwlexMgWxmnxnBdMfH50VUsfatsd/eKx WNmGRp38Iv1I8t1h5JqRV25fHwK+FXVRQo0Fbd12Sp+L1jZIVLFtPupr72pLpYpw JJyjwIY50/00Ohjno1vSCwZLwWMJiGuXMP1cSuVYPFiG2O/Lp4w2zD8iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=G1oqJfYuTS5fo+2YaxQNIcDkIeLpWlAW0XoBux5ubVE=; b=l+IkfDEP XXekLBkFfEH7m/2fAjI/hT+AgXLbZU1WVpr1xqMup9gewEL18qD756ZoEwJjYJrR mShk0ug8yqAXnJGyirbyrZdPi21kXF/MHgaiTMBEiaYuk1n4Q1UahlMSA445FDXn +/vfmsMS5zhFC8R082w9YxX5WFODnvjuO1LsTtBnGUic3iV+ddYo1xNlqOxxlLXm bUHuTk4KibGnnj5KtWgUQrQ1JPTGJoqDhHCDOboSWrzdYGNyX7k/+Y9MabCCErSS hg06Jb6ghuZbC5XWmkYZE0jniPrca1TIjh7vddF7AvDallpEQfOXVXJvr9i0oTP3 8x8x/tifvqnVug== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepgeenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id D40EE1080054; Sun, 28 Feb 2021 07:54:19 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, Hemant Agrawal , Sachin Saxena Date: Sun, 28 Feb 2021 13:53:47 +0100 Message-Id: <20210228125353.2436562-13-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v6 12/17] common/dpaax/caamflib: simplify log macros 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 Sender: "dev" From: Natanael Copa Simplify pr_debug, pr_err and pr_warn macros by adding an intermediate pr_msg macro. This way we only need to test for SUPPRESS_PRINTS once. Signed-off-by: Natanael Copa Acked-by: Hemant Agrawal --- drivers/common/dpaax/caamflib/compat.h | 28 +++++++++++--------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/common/dpaax/caamflib/compat.h b/drivers/common/dpaax/caamflib/compat.h index c1a693498d..9776eed437 100644 --- a/drivers/common/dpaax/caamflib/compat.h +++ b/drivers/common/dpaax/caamflib/compat.h @@ -40,31 +40,27 @@ #define __maybe_unused __rte_unused #endif +#if defined(SUPPRESS_PRINTS) +#define pr_msg(l, fmt, ...) do { } while (0) +#else +#define pr_msg(l, fmt, ...) \ + RTE_LOG(l, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) +#endif + #if !defined(pr_debug) -#if !defined(SUPPRESS_PRINTS) && defined(RTA_DEBUG) -#define pr_debug(fmt, ...) \ - RTE_LOG(DEBUG, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) +#if defined(RTA_DEBUG) +#define pr_debug(fmt, ...) pr_msg(DEBUG, fmt, ##__VA_ARGS__) #else -#define pr_debug(fmt, ...) do { } while (0) +#define pr_debug(fmt, ...) do { } while (0) #endif #endif /* pr_debug */ #if !defined(pr_err) -#if !defined(SUPPRESS_PRINTS) -#define pr_err(fmt, ...) \ - RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) -#else -#define pr_err(fmt, ...) do { } while (0) -#endif +#define pr_err(fmt, ...) pr_msg(ERR, fmt, ##__VA_ARGS__) #endif /* pr_err */ #if !defined(pr_warn) -#if !defined(SUPPRESS_PRINTS) -#define pr_warn(fmt, ...) \ - RTE_LOG(WARNING, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) -#else -#define pr_warn(fmt, ...) do { } while (0) -#endif +#define pr_warn(fmt, ...) pr_msg(WARNING, fmt, ##__VA_ARGS__) #endif /* pr_warn */ /** -- 2.30.1