From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34EECC433ED for ; Tue, 6 Apr 2021 13:22:12 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id B50A5613B7 for ; Tue, 6 Apr 2021 13:22:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B50A5613B7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=monjalon.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A8579140F6A; Tue, 6 Apr 2021 15:22:10 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id 1EDD8406A2 for ; Tue, 6 Apr 2021 15:22:09 +0200 (CEST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id ABFFE5C00AF; Tue, 6 Apr 2021 09:22:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 06 Apr 2021 09:22:08 -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=MJVgljBApXwK/ MhTUayjGp+zHf4Z7cO/yb3mZ7b8p/k=; b=luwfq4xEY2iOHkxjgvUbaTuCl2dn8 eNfnjUXnUi1f+H6jPZFN6JFYEiuF3w5314UUkwMEVvC4Bn9xdPUroNU51NXr8zpT q9HpmO/f6VFTi+aOlERikdSkV1STVkwyJHaMXZP0YAzSfo8Vdqta86cYLcZHMmhf kjJPKkJroO/Jr+JaxAQgkxHHOwcMSfYnEAC/b6NApgfQhug45Tz52Mt2obJPcojM C9mSEuvMWJaBeaqg0eBDGn0UaGJ4QfB6u0+UKggP40spL6jSAgPIskcwJdBbKW4N PlnSZfiXaLidLZgMYKCrfMbG5qWCilSd1ZmppTjhiKVHzZAaqB620Dmhg== 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=MJVgljBApXwK/MhTUayjGp+zHf4Z7cO/yb3mZ7b8p/k=; b=UDfPL6Pi qQJM5Kn9iR29cCH1oAeQ+Yg83HLif5WoYCOaeRR3gt14yjXQCUVw8pFW4FJkWyGP tFpkNpkpjD0y5HhC5nbDeBp4IfzRYWVZt6cZR752zwMMLi6IMVAAub/qx/LVNusi i4IvusDUDBtZ+kmviiYIY2aGf07iM06QScBUg0pVLSfluWi2OT60gHkegHzlhvbL IyH5jeEQpVY7QqneABGM4md7CzAoCO5IP6RYQLTO7sSzoEb2Z8Yf7EeF6ET1mQ5n hD+JIt5MalnFkEWLjwf/ybA7tBOWMSF1xI1/vkSY//Q7NLZhfwUEeUbD5xkP4en0 hXHF7oImp+r9Iw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudejhedguddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcuoehthhhomhgrshes mhhonhhjrghlohhnrdhnvghtqeenucggtffrrghtthgvrhhnpedvhefgiedvjeegtdevhe efhfetleefgfeivefgffevfeejgedtgfeutdehtdegveenucfkphepjeejrddufeegrddv tdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth 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 3F91D24005C; Tue, 6 Apr 2021 09:22:08 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: david.marchand@redhat.com Date: Tue, 6 Apr 2021 15:22:02 +0200 Message-Id: <20210406132204.1818522-2-thomas@monjalon.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210406132204.1818522-1-thomas@monjalon.net> References: <20210310140107.2730088-1-thomas@monjalon.net> <20210406132204.1818522-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 1/3] log: choose EAL log type on registration failure 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" In the unlikely case where something goes wrong while registering a log type, the fallback is to use the EAL log type. Signed-off-by: Thomas Monjalon Reviewed-by: David Marchand --- lib/librte_eal/include/rte_log.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_eal/include/rte_log.h b/lib/librte_eal/include/rte_log.h index 173004fd71..21a7d16340 100644 --- a/lib/librte_eal/include/rte_log.h +++ b/lib/librte_eal/include/rte_log.h @@ -380,6 +380,8 @@ RTE_INIT(__##type) \ { \ type = rte_log_register_type_and_pick_level(RTE_STR(name), \ RTE_LOG_##level); \ + if (type < 0) \ + type = RTE_LOGTYPE_EAL; \ } #ifdef __cplusplus -- 2.31.1