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 A1334A00C2; Sun, 20 Feb 2022 19:22:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E0E441169; Sun, 20 Feb 2022 19:22:02 +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 7698140395 for ; Sun, 20 Feb 2022 19:22:00 +0100 (CET) Received: by mail-pg1-f174.google.com with SMTP id w37so5988192pga.7 for ; Sun, 20 Feb 2022 10:22:00 -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=Q8QyYl/xyznlGryI5tblav2fuGxmlHT14wjQN42pbxg=; b=XW2tngJVbaTldoA8aPZABHUYhqe0i1Qu5zV8oontKBCvVPXRiSi85QKSqS+ZfdCAzF YlHH23ogIHSrVeg4GS5CBeQk+k/VrXfQ+kR2pqT4gP558VTx94t995TEWgyH21zBiZpg ia1yKf3O7KkzUv9hCe7+UT4zMYVQIRRhYTNahZ4J60ATW5XKPJ/lkhD2YmGLPHTzNpPs JQMBPg5ZR5trRJEOSLHKtJjNUgDR9yOqqi5MBJwFv/cdSdy6ABJCE/bqAZlKDCZwqWr2 y0ZSLosZbKQCVFlVtLYoLtCG9w8jWfI0zRQm+SB/bcXYm6yPc2NhBlHnYAYCrxrCN3I0 iscA== 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=Q8QyYl/xyznlGryI5tblav2fuGxmlHT14wjQN42pbxg=; b=ZPfUCTilClb4GGQBQw94cBAGDLK/0edeZMcp5YiMgU/+mCnXFMFcSnU85RdmAOgsAW Iey7O284FKcaACxDngulvwLH3FsH73DZEnD14XosiYIsXw1ypn14gzIEwglJKxcVxnU1 VesYQeboXVs+wqiH8wTOWnNX9xAyE/po3CGJJwGhw0WrU60/hrRV8BU4BBG/jSgSdwYT m/YcAAZDT89mHAlE4mNSSMVDQMCfn5tSNa1RQzY50FVpUYLyUNuxh2GuHG6zgGpUCIiF EKSitOz2Lu7RPc+jllSMBdJ6PoUreVbiQS9zMhra0nQ2ySdKbvtnDA2RbADbpyyxLk80 nrdA== X-Gm-Message-State: AOAM533x1hbU0qFofOfU8hVoqo9hmpME4J/HIyTO2cOjtfUjp/nE/BpK CtFoX49K2VtjYERHV7wkUwTJUlusmTH3gOZg X-Google-Smtp-Source: ABdhPJzTMY7osBjJL1B2mQT0XdejQdSj+HaKkflg16ny7jfRS7bxXvKD8d1Lfd9mtjufAlu5zcoi4A== X-Received: by 2002:a65:5b41:0:b0:374:3159:47be with SMTP id y1-20020a655b41000000b00374315947bemr3124446pgr.254.1645381319343; Sun, 20 Feb 2022 10:21:59 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id u8sm13528107pgf.83.2022.02.20.10.21.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Feb 2022 10:21:58 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Harry van Haaren Subject: [PATCH v3 7/8] event/sw: remove unnecessary NULL check Date: Sun, 20 Feb 2022 10:21:46 -0800 Message-Id: <20220220182147.9750-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220220182147.9750-1-stephen@networkplumber.org> References: <20220219234322.61309-1-stephen@networkplumber.org> <20220220182147.9750-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 XXX_free() functions already handle NULL pointer. Signed-off-by: Stephen Hemminger --- drivers/event/sw/sw_evdev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c index ba82a80385b6..f93313b31b5c 100644 --- a/drivers/event/sw/sw_evdev.c +++ b/drivers/event/sw/sw_evdev.c @@ -166,8 +166,7 @@ sw_port_setup(struct rte_eventdev *dev, uint8_t port_id, snprintf(buf, sizeof(buf), "sw%d_p%u_%s", dev->data->dev_id, port_id, "rx_worker_ring"); struct rte_event_ring *existing_ring = rte_event_ring_lookup(buf); - if (existing_ring) - rte_event_ring_free(existing_ring); + rte_event_ring_free(existing_ring); p->rx_worker_ring = rte_event_ring_create(buf, MAX_SW_PROD_Q_DEPTH, dev->data->socket_id, @@ -186,8 +185,7 @@ sw_port_setup(struct rte_eventdev *dev, uint8_t port_id, snprintf(buf, sizeof(buf), "sw%d_p%u, %s", dev->data->dev_id, port_id, "cq_worker_ring"); existing_ring = rte_event_ring_lookup(buf); - if (existing_ring) - rte_event_ring_free(existing_ring); + rte_event_ring_free(existing_ring); p->cq_worker_ring = rte_event_ring_create(buf, conf->dequeue_depth, dev->data->socket_id, -- 2.34.1