From patchwork Fri Mar 19 14:57:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89563 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 DCE25A0562; Fri, 19 Mar 2021 15:58:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A93C140F46; Fri, 19 Mar 2021 15:57:57 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 9D2BC140F40 for ; Fri, 19 Mar 2021 15:57:54 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 50C455C0115; Fri, 19 Mar 2021 10:57:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Mar 2021 10:57:54 -0400 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=QWu3XEK2rQH/5 TNTlDfaZ0FKUazKkyEth51uiG+XhtE=; b=B7wK1ooS4nDp+ohTocvLJWeRzEYYO CjUi0Q31ciYAIokXXyFrCdyp09mU9B7ejPouN/WiD45qxmMzmwg2ZjkSjXqqfL/O HTucQT57+1doYMDMcsT4hGICdkTB2d+uxZjws+QcX69qD5imzNyJprNqKFxQlBHS glzeT0y9+ts1R5PHktUbhWuuxvQSbZjmIn2PQF0PCKqFqX7RcoXEdfMZ94kScUwD nHU0hLmqml0yUTK2T5Qt4F4Vi8vAiRXXlqN8l9lv7QGtZt+lpld0NHILvRtPV4Gt iGwC8/mtygj1ytvmIDy8ohsd7IsLF9+lFsHH0ydkNdpPVQIoSyr62Lc8w== 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=QWu3XEK2rQH/5TNTlDfaZ0FKUazKkyEth51uiG+XhtE=; b=bBdVmYPv Pp+WCGgZ3vbNNUBWy04b6y1AD3xjV3SoawR2H8XqmYcQq9ax+XOtbMLNqUhPENtn nTY6+Y6RR52cxd1DN1dNld5F1vW8SxItrgEbQhQMjW0X/rd1k/6hyuFTpjMKc3jn gfMDxIjDLCWUmuGbH5EiWTuODIMKCKInVU993Xpu5n2SX8G8X2g6eeALtrzQVIKv BH2X6000MkLhpzOPKAK6wRMeE68GY+mdI1L1vM6Cjugt/FEMZGmjjhdLbBI2IzEM 8R1/2V9feYSZGztOZiOHMKPVNEKhrco8mYXFVk0bj0WZcGQZKfkfQ056HLSnq9us kmWaAXFYCSCeDg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeefnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl 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 8231D24005A; Fri, 19 Mar 2021 10:57:53 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, Hemant Agrawal , Andrew Rybchenko , David Marchand , Sachin Saxena Date: Fri, 19 Mar 2021 15:57:21 +0100 Message-Id: <20210319145730.3555384-9-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 08/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 Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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 */ /**