From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 308E3436D9;
	Wed, 13 Dec 2023 05:21:46 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 6821742F1F;
	Wed, 13 Dec 2023 05:19:46 +0100 (CET)
Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com
 [209.85.128.172])
 by mails.dpdk.org (Postfix) with ESMTP id 6B47042EFD
 for <dev@dpdk.org>; Wed, 13 Dec 2023 05:19:41 +0100 (CET)
Received: by mail-yw1-f172.google.com with SMTP id
 00721157ae682-5d2d0661a8dso65964237b3.2
 for <dev@dpdk.org>; Tue, 12 Dec 2023 20:19:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1702441181;
 x=1703045981; darn=dpdk.org; 
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=hxQxLoDS3vg/T2ba6PLlwpaRQ8BgmKF9iW2xv/u3hxM=;
 b=Vr34Yl7F53Ud6SmlQ7eloAWv/9UFI7LW4SYcwasNA4s+bJ83lDTQDVSnfOYYhrZdg6
 mivC3F/ox52d07risgqvmqlbSh2arJxzYYLPdGw18XzmhrhTkxnjfltu7xjO8MRzbel4
 pkbAZrTfEU87O4FEDnyRv0Vt1x7pdqag934F3fHMxEZCl5/ah4rXjkVqgUzwwzMJn3mK
 tcD4FPnvi1jN/BxdwbjwNcwj1JL1WZZ4rC22685KNVUN+WdXqS0QG7gFjKtfnULq9jIG
 A2CJdT4XriM4QRbdXH85T9iPMtlTfCzFjuBqpNUWjgdOP6VCvoEkFnN69xUOfg9pdnox
 BssQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1702441181; x=1703045981;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=hxQxLoDS3vg/T2ba6PLlwpaRQ8BgmKF9iW2xv/u3hxM=;
 b=EYsLjw7jsR6bpohA4whoH+tcFdKiNIc27FrfKhtreGb0U3GTwWWOS4pEVCvTTwZFQd
 XMsAixqGVZIYcs0N257NfQy1nOsOAxPJWXvImT+H1WEdZEDEIFN46sHeuyKzsQ7WyHfm
 Q332C9rYmlr5R0jEB3Rx/3h4pg9e5R0TDRRZXJZDs6lJTubLA6F4so5N5WURr7WV2en0
 fGWG3kuPvWoDWX3LtmvdhKaw1T6AJiqxJ0BBVf+9XbILspJzqsFZ5Uyy4qzrXSH9j7iD
 cUPEPBubRWkUXe+s0j3qVVVmSHwp3OCoIFKc9z3s41wQtcGA02q5h8y9hw29YdrhFVlf
 ZiRQ==
X-Gm-Message-State: AOJu0YyBpcQgqQU4R0M+z74dvREjlr8rqEvw0Xoh5vBrsL4PLl6LM0jt
 mVGLvIHXseJ59nm6fo2AT17KZzNK1aKVn3gIiuQ=
X-Google-Smtp-Source: AGHT+IFbJkxha8zn8MAlqNJ/mB5w2hi6ROYOUiXd3G+ld+Hn/INIOcIVOGzsLlHIr/0tCU145SK4kg==
X-Received: by 2002:a81:7156:0:b0:5d8:e267:78e5 with SMTP id
 m83-20020a817156000000b005d8e26778e5mr6605652ywc.61.1702441180784; 
 Tue, 12 Dec 2023 20:19:40 -0800 (PST)
Received: from hermes.lan (204-195-123-141.wavecable.com. [204.195.123.141])
 by smtp.gmail.com with ESMTPSA id
 p12-20020a170902e74c00b001d077da4ac4sm9340888plf.212.2023.12.12.20.19.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 12 Dec 2023 20:19:40 -0800 (PST)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
 Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: [PATCH v2 19/25] common/sfc_efx: remove use of PMD logtype
Date: Tue, 12 Dec 2023 20:16:46 -0800
Message-ID: <20231213041920.729403-20-stephen@networkplumber.org>
X-Mailer: git-send-email 2.42.0
In-Reply-To: <20231213041920.729403-1-stephen@networkplumber.org>
References: <20231213014408.612051-1-stephen@networkplumber.org>
 <20231213041920.729403-1-stephen@networkplumber.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

This code was implemented in a slightly different manner
than all the other logging code (for no good reason).
Make it the same and handle errors in same way as
other drivers.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/sfc_efx/sfc_efx.c     | 11 ++---------
 drivers/common/sfc_efx/sfc_efx_log.h |  2 +-
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/common/sfc_efx/sfc_efx.c b/drivers/common/sfc_efx/sfc_efx.c
index 2dc5545760b8..5eeffb065b0d 100644
--- a/drivers/common/sfc_efx/sfc_efx.c
+++ b/drivers/common/sfc_efx/sfc_efx.c
@@ -15,7 +15,7 @@
 #include "sfc_efx_log.h"
 #include "sfc_efx.h"
 
-uint32_t sfc_efx_logtype;
+int sfc_efx_logtype;
 
 static int
 sfc_efx_kvarg_dev_class_handler(__rte_unused const char *key,
@@ -117,11 +117,4 @@ sfc_efx_family(struct rte_pci_device *pci_dev,
 	return rc;
 }
 
-RTE_INIT(sfc_efx_register_logtype)
-{
-	int ret;
-
-	ret = rte_log_register_type_and_pick_level("pmd.common.sfc_efx",
-						   RTE_LOG_NOTICE);
-	sfc_efx_logtype = (ret < 0) ? RTE_LOGTYPE_PMD : ret;
-}
+RTE_LOG_REGISTER_DEFAULT(sfc_efx_logtype, NOTICE);
diff --git a/drivers/common/sfc_efx/sfc_efx_log.h b/drivers/common/sfc_efx/sfc_efx_log.h
index 694455c1b14e..1519ebdc175f 100644
--- a/drivers/common/sfc_efx/sfc_efx_log.h
+++ b/drivers/common/sfc_efx/sfc_efx_log.h
@@ -11,7 +11,7 @@
 #define _SFC_EFX_LOG_H_
 
 /** Generic driver log type */
-extern uint32_t sfc_efx_logtype;
+extern int sfc_efx_logtype;
 
 /** Log message, add a prefix and a line break */
 #define SFC_EFX_LOG(level, ...) \
-- 
2.42.0