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 71D60A04A6; Mon, 24 Jan 2022 01:10:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A61142904; Mon, 24 Jan 2022 01:06:32 +0100 (CET) Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by mails.dpdk.org (Postfix) with ESMTP id 6759F428ED for ; Mon, 24 Jan 2022 01:06:27 +0100 (CET) Received: by mail-pg1-f179.google.com with SMTP id h23so13610680pgk.11 for ; Sun, 23 Jan 2022 16:06:27 -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=thYpsjYl0E1X1k+1rn/zROdYNc0fDNlWfaUsBDTg7KH7BOtDGBl3Iw+Pw6DVE1GpO6 VNT0RyUjqA01gWOai+NidyKRAEgm+VuvgKJMimdl1FTsAvNBW+OkOV4AJRA1g+86Y6my xRxVApLolk1I207yvnIelU5qNSO8SNp03rlDQoj1e/XWULxgF5cViuQ4jHEITMuxx7Iz OjrrIB1ESHENgwtIzBBLJ+GF5xULwITpXFmB1h8XKFoowITIfPfL29MX+p/BTVW32Mx9 YXQzvPL0DyIZM0HZlAVr0EwIDJq73tz5637bYfhEF6OE54qpe+M5kl1I8O3jZFuct5OB CLSA== 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=2zhuHq+4Rni5six/93a1YTrD8mbQhdVrRvan70sP3DskY1wdNb3Qdd5E5WXfjXb+BF sLCzDnKvzKGbBOUJa+49AxUaJ3s5D+qhkiGrMl1NVNj8ZoFhRXObFFe/qukNNCOrblb7 xa4YajyzlBHAbEBYNudITetif1gPZ0p25fkbxR8f325NBvm6n/MIOcnNRnWaecdgf593 7ZrwqNYz49JARtoitaQWlcqMPpoHmAtjPcwTqb6mec886kvKoZ4L1GZVO+OLaJMfNHIh 5RRBDj7AM1YDUF5CSrhtI4oKIbVnHUVaf49QMP3lHLIHnHSMxCsBXBe9STFNM68hbht7 tBfw== X-Gm-Message-State: AOAM532stbdUwjKlMCWcwgZpk8TUzVVBZyQ8bXB2D46ZbR5HaJ0ov0Pd firWsKXl1cygeIaZH3vmTh2AsJpv4tAdzA== X-Google-Smtp-Source: ABdhPJzdcU8DEB28dMSsAqSouDnkPEcEcUmbB1++6U9qCJKJv0ixC6VPsdySlCXNaH4VXQZcHaa9mQ== X-Received: by 2002:a63:36ca:: with SMTP id d193mr9996656pga.88.1642982786396; Sun, 23 Jan 2022 16:06:26 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id ck21sm10935350pjb.51.2022.01.23.16.06.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:06:25 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Rasesh Mody , Devendra Singh Rawat Subject: [PATCH 62/82] net/qede: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:04:58 -0800 Message-Id: <20220124000518.319850-63-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220124000518.319850-1-stephen@networkplumber.org> References: <20220124000518.319850-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