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 1B4E7A034E; Wed, 9 Feb 2022 20:19:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6AF15426D8; Wed, 9 Feb 2022 20:18:12 +0100 (CET) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by mails.dpdk.org (Postfix) with ESMTP id B838441C25 for ; Wed, 9 Feb 2022 20:18:10 +0100 (CET) Received: by mail-pf1-f181.google.com with SMTP id n23so6031020pfo.1 for ; Wed, 09 Feb 2022 11:18:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6/+pQYjfCq/cVkJ1whwx2XISwIt1WAaIelrwbKQxdIU=; b=gn5jw8ibnze3IBVePvG3I0ylaYAb0lBq8zpswkXzMjVyGaPqgFyaorM1TlLN0uq7vJ znaJ5xDC/eV0xf9++vVI7DQICxXy7uGUQNkaOp+Nr17nqeTe1rtWl+q6mzfhiYf5k013 ctRd0O09605Sk6xlRmj5Y9Lx0j6qE8S4PdJVu22AG0QZVMoot8U9wCI6cCunh7GuDnA6 ypYDnd7FmieTWM+3Ww85YXnQ7TcfKTmgVkhUY3U8pUBNqX7XP64KZbkn0AdPwO+m9A2S SEtz6vqhl2xivu50h0XhINlWBPiFOf+GcjT0cpqyT5uE3KkP03WOZYAgkQcyjl0+HyqX Thrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6/+pQYjfCq/cVkJ1whwx2XISwIt1WAaIelrwbKQxdIU=; b=wxtABfV4kyOIKLUoldmp9SZq2wApeWbjL2BLS6HCbyd4t3S76Q3wAQ0O5XGxk/L1v4 D8hI1wPLI7Zcmu4pGB+7Z8jwlOU0X2/rV9GAy3KjPkLczKrBPxD3CFc3Bikpa6egjauR bQdn0SEGpA97Cm5OSnxSxUxE9xnf8env4n/kjtnJG9YlJUT7opdXI4ZpEE0RHe84zTTO Oa8SDhDwwCKM9QoWUAbt8azU/2Z27A4IELeqwJ1AjUSd4umreMEy8YUBNpoHRFWepDLx 3Y4DGEkFBg9xFPOdVP1CKnxRIPaycngYDHYo2L0Yy23TbEfMzDx3dBseB4Srz/NwlFKB A7LA== X-Gm-Message-State: AOAM5316J4Ls0IwIPRrP5rP40JCyeEZ/jvnlhcNuMbxBR4iM8YYD2hmd Ms7kIGXJ/wkO3mYeKGOSUKdW4Ru4PJSrgbLK7pY= X-Google-Smtp-Source: ABdhPJzmCIASmn9vgEl0YhyED5hIGSqdb6fL4tUUk5ZkBV5mSA4bVmZBGXzGleLvjF5aSf3cVrtkOg== X-Received: by 2002:a63:5242:: with SMTP id s2mr3024608pgl.435.1644434289618; Wed, 09 Feb 2022 11:18:09 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id u16sm14378401pgh.54.2022.02.09.11.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 11:18:09 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Rasesh Mody , Shahed Shaikh , Ajit Khaparde , Somnath Kotur Subject: [PATCH v3 15/36] net/bnx*: remove unnecessary NULL checks Date: Wed, 9 Feb 2022 11:17:27 -0800 Message-Id: <20220209191748.377729-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220209191748.377729-1-stephen@networkplumber.org> References: <20220124000518.319850-1-stephen@networkplumber.org> <20220209191748.377729-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 Remove redundant NULL pointer checks before free functions found by nullfree.cocci Signed-off-by: Stephen Hemminger --- drivers/net/bnx2x/bnx2x_rxtx.c | 6 ++---- drivers/net/bnxt/bnxt_ethdev.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c index 66b0512c8695..00ddccf151fd 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.c +++ b/drivers/net/bnx2x/bnx2x_rxtx.c @@ -27,8 +27,7 @@ bnx2x_rx_queue_release(struct bnx2x_rx_queue *rx_queue) sw_ring = rx_queue->sw_ring; if (NULL != sw_ring) { for (i = 0; i < rx_queue->nb_rx_desc; i++) { - if (NULL != sw_ring[i]) - rte_pktmbuf_free(sw_ring[i]); + rte_pktmbuf_free(sw_ring[i]); } rte_free(sw_ring); } @@ -172,8 +171,7 @@ bnx2x_tx_queue_release(struct bnx2x_tx_queue *tx_queue) sw_ring = tx_queue->sw_ring; if (NULL != sw_ring) { for (i = 0; i < tx_queue->nb_tx_desc; i++) { - if (NULL != sw_ring[i]) - rte_pktmbuf_free(sw_ring[i]); + rte_pktmbuf_free(sw_ring[i]); } rte_free(sw_ring); } diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 22e015d5aa80..261fe0be56c3 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -5887,8 +5887,7 @@ static void bnxt_free_ctx_mem_buf(struct bnxt_ctx_mem_buf_info *ctx) if (!ctx) return; - if (ctx->va) - rte_free(ctx->va); + rte_free(ctx->va); ctx->va = NULL; ctx->dma = RTE_BAD_IOVA; -- 2.34.1