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 7E1AAA04A6; Mon, 24 Jan 2022 01:09:37 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CB989428B7; Mon, 24 Jan 2022 01:06:14 +0100 (CET) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by mails.dpdk.org (Postfix) with ESMTP id A5871428A2 for ; Mon, 24 Jan 2022 01:06:10 +0100 (CET) Received: by mail-pg1-f178.google.com with SMTP id i8so13593986pgt.13 for ; Sun, 23 Jan 2022 16:06: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=Hh4/1zquMB27nawFN14YTg0HzkWoq//klYDRDVFoYNs=; b=kNZBqp0FRzeS7ikUANYMwxXcFBfpAkj4AeD9cYvJaFk5RdCsf8WTIYrRRXkjfX48nz k27dcBA6N2r3JWvQlcn+0Mhw+GBoxZOGVAAY8dzQZ+9Z96LBqEglybjxTwFi6QsSLA8z otPAfpdMFpmzejzs/nx7HSGxyy0RXhO+6TyuPOTJCaVFm2xCB9CYk8oP7kwNUDUz9syk ij7/oXxvXSLk7Kj8k0Xyj0Ofz0ON2OLkUosSfOqZolID6RiqdAMExm/1n/jQ8Lgxyb2T NVw2P86/jEkczPqIgW6EK8eiw0+Oj1cTQ7T8o/6FifzgMnZuseBzV5ipN5dlpAtlq/cO eefw== 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=Hh4/1zquMB27nawFN14YTg0HzkWoq//klYDRDVFoYNs=; b=JrZHI3CclIu+Qk5gKDm8zX9Gd+qR1L85CQoBmj6HYPlKBBrsPE+iNq/HC2YZ1u4bb3 QVYdVQ2LX41a5n6XZMeLKOk1gj/WQu5lJwGKI80K2bBBQQF24rrvz/bRgenoZ3qIOuCZ FuKmSz+aZqqZqiCrP/hWE8FIbYawGtHdCFG+d9K0lv2lofXo4+bVGRpk4tMFyQjwefK2 csoxPioY8PxbbPM5A+OVJIQZfvANCsNyxEOlK8iJVGvIJjquyDm94ZSXhc016z3nIKvM 5v4f+33qqtgY5OOyAjXXwAUAt57/o8b+0wyxBqrm2wVg3jMS4HaobFiPLfWkJ+9T+eJg HWcQ== X-Gm-Message-State: AOAM530BZyN9MyIr7HZdEDQA3IyLZ32G1fdb3EjsWD/BDAgCaaPb2zuc VQnGrihjW1jjL6fgPDZgPFTuxPY9MfUPCw== X-Google-Smtp-Source: ABdhPJzYdHqq7dnxyLiGNvO90mpkNJbqGcMbs5gPGOn8ps6p/do1P3RbAaaoCysQqZ9+XNvQOaEjQA== X-Received: by 2002:a63:4e58:: with SMTP id o24mr9909323pgl.525.1642982769668; Sun, 23 Jan 2022 16:06:09 -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.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:06:09 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Hemant Agrawal , Sachin Saxena Subject: [PATCH 46/82] net/dpaa2: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:04:42 -0800 Message-Id: <20220124000518.319850-47-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/dpaa2/dpaa2_ethdev.c | 3 +-- drivers/net/dpaa2/dpaa2_mux.c | 3 +-- drivers/net/dpaa2/dpaa2_ptp.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 2b04f1416853..6b85b7740cfa 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -504,8 +504,7 @@ dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev) /* cleaning up queue storage */ for (i = 0; i < priv->nb_rx_queues; i++) { dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[i]; - if (dpaa2_q->q_storage) - rte_free(dpaa2_q->q_storage); + rte_free(dpaa2_q->q_storage); } /* cleanup tx queue cscn */ for (i = 0; i < priv->nb_tx_queues; i++) { diff --git a/drivers/net/dpaa2/dpaa2_mux.c b/drivers/net/dpaa2/dpaa2_mux.c index cd2f7b8aa544..bd4596b89149 100644 --- a/drivers/net/dpaa2/dpaa2_mux.c +++ b/drivers/net/dpaa2/dpaa2_mux.c @@ -353,8 +353,7 @@ dpaa2_create_dpdmux_device(int vdev_fd __rte_unused, return 0; init_err: - if (dpdmux_dev) - rte_free(dpdmux_dev); + rte_free(dpdmux_dev); return -1; } diff --git a/drivers/net/dpaa2/dpaa2_ptp.c b/drivers/net/dpaa2/dpaa2_ptp.c index 8d79e392445a..5fcc36abe7b0 100644 --- a/drivers/net/dpaa2/dpaa2_ptp.c +++ b/drivers/net/dpaa2/dpaa2_ptp.c @@ -168,8 +168,7 @@ dpaa2_create_dprtc_device(int vdev_fd __rte_unused, return 0; init_err: - if (dprtc_dev) - rte_free(dprtc_dev); + rte_free(dprtc_dev); return -1; } -- 2.30.2