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 46A55A04AD; Mon, 24 Jan 2022 18:53:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8078D42963; Mon, 24 Jan 2022 18:48:34 +0100 (CET) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mails.dpdk.org (Postfix) with ESMTP id 66FBA42909 for ; Mon, 24 Jan 2022 18:48:31 +0100 (CET) Received: by mail-pg1-f174.google.com with SMTP id q75so16028054pgq.5 for ; Mon, 24 Jan 2022 09:48:31 -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=ge/FJhu17ijyXcd3XG2ocB4hhvAimFOCzaaCeUqhKgw=; b=swlnxKPBqw236qAVfwKJtQZcw9Mj6sszKcPfrx36wu+jc+tvTW8c7hNIlxs8TpSgLE uYGXKmZONMrZxwCvv7+AJe1baW5t4gMRZvhW+6k+6m0jEiAaqEubY6qjeXSFAFDHZZ4w FCwJXgsORwhFLQVM8236RKMTmX3pCQpmetgeUcswvZIc2lAOt0wE+EvFaXb9QCFZ0Lds E+ETONeJwq18dx2b/5Lr9Q0BGNW/g42+uZkO4ifsPJ+PDiSxZGTPvNCqsWFxXJvM6p+p 2d6emSUk2MwwUGBavJoxUGEGXdHAfk3BkdjcM0eTCxxvZwmrH4Tx3mPEY1yTXgYG9t8U TIdA== 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=ge/FJhu17ijyXcd3XG2ocB4hhvAimFOCzaaCeUqhKgw=; b=Ig9qOOvMXoAGHyFj8VBSEKC+kXcQLF47OwlpMnd5lb9dd9FjKAx239YfGd8MTdwbhi f0RZnB5e5melhvrSX7m9fDQ2bi3fhlLCt4jJuRSK2Xdmc3NITIhTlQu02JdU1NoLqHi9 nQGrN8DQrCmPP2jS5YYW9dYBcVXsCBsHkCHIr2q2omidiE+1ugfIlVSLIYbIZuUasy/o D6PtlEBg9WISpg1fMGOvYL2CnJzzX6JWj3ZFToEIJYRNOQ/UPPia9jd72k2z6F3TlSoF SgryV3oG05Pe2B3ZnX9fsFgUREAWuBnRnAIz8uWRVwawjAcE1Do0NLcP5/K1kJSJQbFt p7oA== X-Gm-Message-State: AOAM532d3RLNEF2I0BQ37X1QZskisCSQa6fO2DlWqCLR1HIunytjHGGt DZO6amdplVjAOLWcRC5r2EVQSK8yQUYEQg== X-Google-Smtp-Source: ABdhPJwGWvJnr92bD6BJTZmBkvkEsYH48GAlYMihz2xmlPd4IpN48oYcurJwDj/s/L0ESU+FqusBPw== X-Received: by 2002:a05:6a00:be5:b0:4c7:f615:41de with SMTP id x37-20020a056a000be500b004c7f61541demr9471074pfu.34.1643046510478; Mon, 24 Jan 2022 09:48:30 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id q7sm15835082pfs.37.2022.01.24.09.48.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:48:29 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Rasesh Mody , Devendra Singh Rawat Subject: [PATCH v2 63/83] net/qede: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:46:59 -0800 Message-Id: <20220124174719.14417-64-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220124174719.14417-1-stephen@networkplumber.org> References: <20220124000518.319850-1-stephen@networkplumber.org> <20220124174719.14417-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/qede/qede_main.c | 3 +-- drivers/net/qede/qede_rxtx.c | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c index 2d1f70693a3d..ad101194d613 100644 --- a/drivers/net/qede/qede_main.c +++ b/drivers/net/qede/qede_main.c @@ -335,8 +335,7 @@ static int qed_slowpath_start(struct ecore_dev *edev, err: #ifdef CONFIG_ECORE_BINARY_FW if (IS_PF(edev)) { - if (edev->firmware) - rte_free(edev->firmware); + rte_free(edev->firmware); edev->firmware = NULL; } #endif diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index 7088c57b501d..1c0a6ba5f1bf 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -706,12 +706,10 @@ void qede_dealloc_fp_resc(struct rte_eth_dev *eth_dev) } } - if (qdev->fp_array) - rte_free(qdev->fp_array); + rte_free(qdev->fp_array); qdev->fp_array = NULL; - if (qdev->fp_array_cmt) - rte_free(qdev->fp_array_cmt); + rte_free(qdev->fp_array_cmt); qdev->fp_array_cmt = NULL; } -- 2.30.2