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 E9DE8A034F; Thu, 25 Feb 2021 19:24:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 715FC1608B2; Thu, 25 Feb 2021 19:24:00 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 8A70E1608AC for ; Thu, 25 Feb 2021 19:23:58 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 33C8B5C00AF; Thu, 25 Feb 2021 13:23:58 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:23:58 -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=nEX+kIBAXUiTISFSdlbH5/YLTt7dx QHNUq2IrJhDOSInbVJk25ZeHtXy1G/ojEgaiv9gY05Mmtd/moGApuNOjp5dpXKE6 3Fz4BmEmkkiesetHOfhHTzH1rqe7AEDd9vtRbQWZqnD5iyhuLkq13r3thXdR+2WC i04bCsGd6/ODiLpp+KUhgNWxIfkrQtzv9v7uaa39YkspwsWC7XTP+NaJMEHVxiHt e6eiEcJobwui+OLSPSay94Q9uqKJeJTpf8cRliLrSiUjmaKCAJZ0U5iadm2YkaSm pVjyW9pq7s1twlqTxs9OCSDtfVsbC/4sog4PiVP70RjoJkzJ7TDtCfj1A== 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=kQmHsYQt 3ybSG6PGW9UD52X31NwZzNtrK8s3+J4WSawKmq60SKP8knqPTRTbc/B5yw+3KP1+ cOBjfL/U7fwMLkGeiUO6aCFMObv1u+Wlegn88i6fMvDz0Jw0Yh1hlpCLqA3xIkoX vDHIpCDbixLXUwBW65LnkOx00aqf3qu/nHN1u5bnd5dIeozeUFcj61riHybEl/Rq s37BnkRLlG0XkmKhiLdQIWtcm9932wFN6xmJjiUnTIWRoWjkemQ3jENKxR+pGDX1 zxJ0iNsClPzZ6J4JQEiYFs3ZBPq7klDwTgILDKrL01dsUcRKnIh3fUMT/DK1pCv7 A6US/xRqZu65cQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeelnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght 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 9890A240067; Thu, 25 Feb 2021 13:23:57 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, Hemant Agrawal , Sachin Saxena Date: Thu, 25 Feb 2021 19:22:45 +0100 Message-Id: <20210225182250.1149592-13-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v5 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