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 58D12A034E; Wed, 9 Feb 2022 20:21:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD6D342715; Wed, 9 Feb 2022 20:18:26 +0100 (CET) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id 4229A42711 for ; Wed, 9 Feb 2022 20:18:25 +0100 (CET) Received: by mail-pl1-f171.google.com with SMTP id 10so3093966plj.1 for ; Wed, 09 Feb 2022 11:18:25 -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=lgZGr7JAlxo3gJVjfmq7K36mDAxa8sRU/W4GUHiVGc4=; b=TOrI2fEzdtR/r3b0G0wk+gyvyJwivKHW0FbtZhFhncX5M6tZTDa/PnfxuoLOLPSfPM SNNKEroKKCbc5/VTIxG01qWCygVs1Pwmy6jn+ANFvWByEwC7fen6H+0/uQpbG5mf+hoh OgjZqhez+XNRScD9KP7xhWtLxqfwg36RSSMznkAcfZARvSXBslgnfHBbiysDBmyk3V+H fIVL4SW1m4jFyHBXeVTYDvsWkR4P4tjPcipGv7nFcitgk1PYjvrD9pJqi7FP9x/gTRW0 cF8rAD/Ht9UjIjQmVEwo/8vDdYsezSfFFuU0+eJwL5u5dVslfUG9eTZzx+6gv7BvUXkm 5vlA== 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=lgZGr7JAlxo3gJVjfmq7K36mDAxa8sRU/W4GUHiVGc4=; b=lSzlKS+sZL/aKjPbnNvBp0erp+GV2w8N2eiWKn2gPWTg7fmOoDc17EYwNk3aIPPYR3 MJWT40hsq3yklgGBza5Gs6n+X5b2+tdsmwWzatrwR7KOL/ZWWH9G+tjvFcg4p3xw8ebz e8d3m4NFcTTQg1vRtvXUdcAAOWaXnoXFB9oCzkLSIUQvUwbGsNYjFgYsmF9YXc3X6U/5 l1fde+m6XIvzL31VnJpI6XEhLVa5CJZIlNAES8xBodVsw6AOkgd8vKyPkKGw8yWdWfFv d+olmhvJyelQ3J5txTk3akZx+lxBuS2873p+eo8+9m2SANRoM1+nRFpH7N7ZNGtHWGVb Vcaw== X-Gm-Message-State: AOAM531x8HSRfM8LmEXWcy+xcnzrBprsyZZcKc8lQLhOKFlu5dXGdEVm AthLjfCQwTn4xyQlQIFakL06qrg1LGpDPgLZWmE= X-Google-Smtp-Source: ABdhPJzAg7ihzB19V31RSToLKIvRgxYF9EyFOAoGnLJux0SWuE+5/CHeCmM1sapfSTxuvQteVbA5ww== X-Received: by 2002:a17:90b:4b88:: with SMTP id lr8mr5058896pjb.166.1644434304268; Wed, 09 Feb 2022 11:18:24 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 11:18:23 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Devendra Singh Rawat , Rasesh Mody Subject: [PATCH v3 27/36] net/qede: remove unnecessary NULL checks Date: Wed, 9 Feb 2022 11:17:39 -0800 Message-Id: <20220209191748.377729-28-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 Acked-by: Devendra Singh Rawat --- 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.34.1