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 3B84545D0B; Fri, 15 Nov 2024 07:08:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EEE0442FCB; Fri, 15 Nov 2024 07:08:05 +0100 (CET) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id 03EE242FAD for ; Fri, 15 Nov 2024 07:08:01 +0100 (CET) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2e9e377aeadso331742a91.1 for ; Thu, 14 Nov 2024 22:08:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731650880; x=1732255680; 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=09HYrnJBn0x8vk1zjSrsui0/PmnW3Sx7BlHOpIMcT5zLixaYAxcB+v0Z6S4KFycfUI r2yQoiGIWueNDipUPX8upinI2YG6V/Kc0ZXW1gTwMAV1jnrCVcQyaG1PrSAhVR5/OY6S 8F+fg+EF9anDYXBNzfVKGpEzN3SgJn3divmcIcKaUskupXhD3UfEMBp0OBRfWAB0RwvG l/Ph+2zHp4MclH8PSm0dKPY40LPvw0IrYJcyPZlEV1QD4sizd0ozfIi0JLAS9XvYKYj5 ewqlVvLogBjJr1C0UMKXS56LposXU2mlGG+lM6E0Fp+YFzxkBQPQzQPYcuQgdbNyL4xj docg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731650880; x=1732255680; 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=W28hU/F9plpxdSytp6EtYlWJN6/LL97///VdG4RwAmP2rRKJum1kpX5R7H6/SQQ83P RnA93UPWg/RQvak+ZXpxzW7VJKe28SH5z6IxYpsQ6jDub4G0FauPzM8DHczYCltltMyf gUiNDd3EIP/2BYpXBtyNT9ZqVEH2EXpGVbDX2THkx7nA0O2FK0Ig2VjuGe4UIgT+6Pz9 3tGpEYeaxi7LCN+eLlowN8eM8g0hdYFXxFRmzjNR8K9GQheRsj3CPnYt1Umv2gJ09VYL uwy+CajsDqquyY2YK5yM59Dm6aAy/T1D+yDXclfBDaYQng2Fn6+cGgUSNXMMaRDO8y1U 565Q== X-Gm-Message-State: AOJu0Yw3NsjvP7mbWYKhzuChXORkLBVtwZeNaGB9lNGHz2vmhwBbIKuo pQqNL1sl1Utd8GqY11w+I3+XLy4aFvESBXcXvmjXJhODCwtm68QLtwNnESqldhuh9UInnPSqcR2 I X-Google-Smtp-Source: AGHT+IEGtBZSmAQNjTA4qC9gLLPzRzgbnGsdj65xLWVXExWA3LMHI21lcEfmOYNJSPSVQPuHvGrVug== X-Received: by 2002:a17:90b:1dcd:b0:2da:8e9b:f37b with SMTP id 98e67ed59e1d1-2ea15586be2mr1960382a91.24.1731650880072; Thu, 14 Nov 2024 22:08:00 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea06f4856esm2123781a91.23.2024.11.14.22.07.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 22:07:59 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Vamsi Attunuru , Anatoly Burakov Subject: [PATCH 10/16] net/octeon_ep: remove duplicate code Date: Thu, 14 Nov 2024 22:05:47 -0800 Message-ID: <20241115060738.313190-11-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241115060738.313190-1-stephen@networkplumber.org> References: <20241115060738.313190-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