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 2222EA0093; Thu, 10 Nov 2022 00:46:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 951F840156; Thu, 10 Nov 2022 00:46:56 +0100 (CET) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mails.dpdk.org (Postfix) with ESMTP id 2E5FE40150 for ; Thu, 10 Nov 2022 00:46:55 +0100 (CET) Received: by mail-pf1-f173.google.com with SMTP id m6so260153pfb.0 for ; Wed, 09 Nov 2022 15:46:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=e8zBhTF4zO2j18HYPLKeG1ulVs3p7/kmyKRPOQvYC/g=; b=4kBdl+CfGoAiRQE7dXy8kkocTNqH3XWFY9KduOnaKyFDrMXsBlGheHydq7ggtXWP5q zwStc5NiPhVvpjg5/3KGCNB5UcyxjmAxxyYIYpiuf4QZucqbKzBGZaZRYpz7kRinUdnn f3PYctvUUsJ35Fcb9CBgvmw6vHoDO8GEK9gg9PHw0MnpDY5qDMLUPlwwp4zeqT+0wDS4 WSVmBmdbk5Vi9HuVtzGmI0miH3G8xqAfNpU6U4OpdxydnLLCta5vafnlDVURtp9/FAjl StGH845QQdMD0FkQZbmnw3DRUiUC+gYTlO71wTNUAMeu2JRYToTgZsLauHMggltLnSn0 HMKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e8zBhTF4zO2j18HYPLKeG1ulVs3p7/kmyKRPOQvYC/g=; b=p1rwEgEqZaQF9ThABASIAOiObAy64xsNKvoua6ACDBnUIAlaD4DwDAqP5WBmAmax4O XcFJSsQONlk3g6+e3LK/MFMXYefUvSj/X7MUJtad/DY72tgj8giolmEJ0ltmZEwg7/3k ONhRt3XRLfL50Epip6npTsFtDkbQT8RZvBwtocRmuqExLw6xTsktD+Q6Q3J2G1SpCIpR XX5iVsTPA6JI1VZWp3pElMzz62wGFBZs6YtHtvAbz5FA7XFg9eOdCjUqu2kFvP++EcAf MGqW10mU4TvM6ZIZEAFeu0QeSau5BJFeEEvJw75Lg8UYxV9uIl/vLM5IgAil6sGv3tu5 y56Q== X-Gm-Message-State: ACrzQf2YkuqSB6zqW6W+Y/s3fexnUY71wQXHcWn3aoNBnhTBwo2Lr+uU HvIJH6PxgC3gpxTgBsVV+zeLVhr49PWXkQ== X-Google-Smtp-Source: AMsMyM6O3jnW/nEsWigBhHKNSNv9piA5Q5LvVtPIKpboEm6yL/FQlPqnw5iT4ViWFkyFqZLd5CHrVA== X-Received: by 2002:a65:628f:0:b0:43c:dac:646a with SMTP id f15-20020a65628f000000b0043c0dac646amr39497453pgv.397.1668037614076; Wed, 09 Nov 2022 15:46:54 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id e18-20020a63e012000000b00470275c8d6dsm7895259pgh.10.2022.11.09.15.46.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 15:46:53 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Junfeng Guo Subject: [PATCH 1/4] gve: remove unnecessary null checks Date: Wed, 9 Nov 2022 15:46:46 -0800 Message-Id: <20221109234649.331942-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221109234649.331942-1-stephen@networkplumber.org> References: <20221109234649.331942-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 The function rte_free() already handles NULL argument; therefore the checks in this code are unnecessary. Signed-off-by: Stephen Hemminger --- drivers/net/gve/gve_ethdev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c index 0086162f63b3..a05e61feba1f 100644 --- a/drivers/net/gve/gve_ethdev.c +++ b/drivers/net/gve/gve_ethdev.c @@ -81,12 +81,10 @@ gve_free_qpls(struct gve_priv *priv) for (i = 0; i < nb_txqs + nb_rxqs; i++) { if (priv->qpl[i].mz != NULL) rte_memzone_free(priv->qpl[i].mz); - if (priv->qpl[i].page_buses != NULL) - rte_free(priv->qpl[i].page_buses); + rte_free(priv->qpl[i].page_buses); } - if (priv->qpl != NULL) - rte_free(priv->qpl); + rte_free(priv->qpl); } static int -- 2.35.1