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 D69CA45CD8; Mon, 18 Nov 2024 19:23:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE8DB42DD4; Mon, 18 Nov 2024 19:22:18 +0100 (CET) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mails.dpdk.org (Postfix) with ESMTP id 4D253427CA for ; Mon, 18 Nov 2024 19:22:11 +0100 (CET) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-20cb47387ceso49065ad.1 for ; Mon, 18 Nov 2024 10:22:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731954130; x=1732558930; 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=qlBwZrxbKN5JOJ1PvUaleL0Ty1G7a6UCAjgyhn+1H+o=; b=htZOPE4aaZEd+kSUNy5mbKfZM7337qI4SxzSa8vqKYf6SMTKRMn6xVzWQj4HmX2/26 IuyoURvYj22ZEN6exVhqwENiMrjZshieLmpXIURJEytFKgowhmwUv1+b3c50B7F+Skpd uxT0WMwA1rm7XfKyMt8KlnV2LgRaSwvAgOM132RupypQHziEWQmJoNi9tzNquF/0FZbi KfPtyf+765FtWlx5BTDo5rAbGqsDEqnQYqg6C2vhYX/UzopkGv/rrxaWqaQ9uIFhHTvQ 8CSr1igD8zb26PClJQcOJLOms/avPRQyti9E15ZF+2uwuhm/viRlPsoLhwskL34s3Lkq HyRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731954130; x=1732558930; 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=qlBwZrxbKN5JOJ1PvUaleL0Ty1G7a6UCAjgyhn+1H+o=; b=jfWdiY3RX/LveddiV3DHuSQtsDSAx+qMEJt39oaBqqvdH4qJTIPt0JnjdfcJtLpyJV hOc+HzaD56zSJcip1smIzNH9nfvpZ+ljkV+lithCSSrlt3DPz+MdnejTQbrHi2uVqSWx gRBDyqlTyZZFGx1L4vG4DYnuoEajRtQ55ffh4Mu8Jbxx/KJie7kR80zqoE1Qe8w9Q6Lv rdI1Ii/hXTZEQ+ttLNQlxo5djTlkwnLvszN4kx38TivUa+flxc+rb6wH2ht2vKeBDarn rXGOaWkIDTG2VDy4kzdZ9pDiPj3Pk4Wwp8CEJ6pRAq8DGeP6wRhnrmd+3rL6qd8dhhxi 6asg== X-Gm-Message-State: AOJu0YxKYmG7vZQN2Hf882iawr9tQEgymKIlZ39dHeA+8LkiK4RiRQuu nM7rAMu/eQRjLf5Gg09q9qqcnsdhC4Knkc6lSXKzVrvjjGJjoWY+JL389VMoTiWkyD9/lI+BxYj X X-Google-Smtp-Source: AGHT+IGvQL6QslvBb//ZPMjnQTMxxdPDk/IXtDNT8zutlxIZ6ORRGXn1F3u8fQM1AxZlJOrJ314c8A== X-Received: by 2002:a17:903:2288:b0:212:f64:8d9f with SMTP id d9443c01a7336-2120f648ecbmr98589235ad.32.1731954130488; Mon, 18 Nov 2024 10:22:10 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea61869bb2sm2916724a91.12.2024.11.18.10.22.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2024 10:22:10 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v2 10/19] net/octeon_ep: remove duplicate code Date: Mon, 18 Nov 2024 10:20:51 -0800 Message-ID: <20241118182153.87042-11-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241118182153.87042-1-stephen@networkplumber.org> References: <20241115060738.313190-1-stephen@networkplumber.org> <20241118182153.87042-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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Both sides of the if in uninit are using same code. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Signed-off-by: Stephen Hemminger --- drivers/net/octeon_ep/otx_ep_ethdev.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/octeon_ep/otx_ep_ethdev.c b/drivers/net/octeon_ep/otx_ep_ethdev.c index b4f8baf3b3..8b14734b0c 100644 --- a/drivers/net/octeon_ep/otx_ep_ethdev.c +++ b/drivers/net/octeon_ep/otx_ep_ethdev.c @@ -721,14 +721,9 @@ static const struct eth_dev_ops otx_ep_eth_dev_ops = { static int otx_ep_eth_dev_uninit(struct rte_eth_dev *eth_dev) { - if (rte_eal_process_type() != RTE_PROC_PRIMARY) { - eth_dev->dev_ops = NULL; - eth_dev->rx_pkt_burst = NULL; - eth_dev->tx_pkt_burst = NULL; - return 0; - } + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + otx_ep_mbox_uninit(eth_dev); - otx_ep_mbox_uninit(eth_dev); eth_dev->dev_ops = NULL; eth_dev->rx_pkt_burst = NULL; eth_dev->tx_pkt_burst = NULL; -- 2.45.2