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 B8468A00C2; Sun, 20 Feb 2022 01:52:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 009EE4116E; Sun, 20 Feb 2022 01:51:57 +0100 (CET) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id 0E29D41155 for ; Sun, 20 Feb 2022 01:51:53 +0100 (CET) Received: by mail-pj1-f52.google.com with SMTP id b8so11728033pjb.4 for ; Sat, 19 Feb 2022 16:51:52 -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=JmXi31/r8tlV/948CXLr7AjGfC9uW5LXdCV6pMs+g48=; b=f1Jl3Sf3FJRgg1nVw+WcdyHTuTMgvaEXYRIWGTwIKhbjKpuOUb983z9pRRHXBbiR0K Y4vXGYDoTVy0Khhgs4LNnUtqtsiYfNa+nWgqlbNkDCKysoLsF3jGyiRBMIYg0DWIBhwk uWIlYEe6GesSiZO3xV2m55UZLxG4YN9P9hhrdi7VPAv68bo8AzNwr4qX2p2AGg6bNMTD B0lXRtRn8B1piKXRUVroVcsKmw6/54i0kHoGInrcDpVbyDQfcz6Az3P2mJfL2sYoJSrq ervq/mgfVaPQAancoq2YNlUtz/krd/KarP+77lt2XNxdrD8U4T8WfbaTw7vMBCFCS3f9 Yk2Q== 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=JmXi31/r8tlV/948CXLr7AjGfC9uW5LXdCV6pMs+g48=; b=iT9ZLdoGqWq653QPufCGSoEiqGHtxfSZ7HFoA58eIlxutnedx9eWrqtXvM7qIvgS/E uJCjQ6Lcz8aieek8/OSUemI2604PZm3pavfzvLOKhK0D9rJeYptgTVDrQ7lwLBcOaSIB uF0x5061x/KP3HxcQPOZ4xhQ3RiEyzwf0tQQEF5RwDYv9LnBSt/C9jP0gSiiFAYlg5CL eUzsRibCEKDHISHc3WNkiGbvifrLiGAOt+HqgYYIdXJ427J1H8IQ/DIEbZx8LVptMNKu uwVUVjkWuhIoqZ7hp8n5/hubkivE4u7rTMAe2/Qn8KHFeJlLnJAn7h1h3+OtO7WiA4tb lhVw== X-Gm-Message-State: AOAM533sba8PXi5VcpwEKgxSvKl4LM9UjSrJ91+L819e8HMizhaDROK7 1IeA4IXpm5dcr/9HkQda01EX04wxf6Reh6Gm X-Google-Smtp-Source: ABdhPJx2OTGhvzTWcQGqlz4ugTkpnVGZSDgvqhv+RWHPnZGtXqdNnZOKWbhOKVPjn6Sq57H04v1fhQ== X-Received: by 2002:a17:902:8ec7:b0:14a:c442:8ca2 with SMTP id x7-20020a1709028ec700b0014ac4428ca2mr13459832plo.12.1645318311989; Sat, 19 Feb 2022 16:51:51 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id f7sm8129695pfc.0.2022.02.19.16.51.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Feb 2022 16:51:51 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Harry van Haaren Subject: [PATCH v2 7/7] event/sw: remove unnecessary NULL check Date: Sat, 19 Feb 2022 16:51:40 -0800 Message-Id: <20220220005140.78713-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220220005140.78713-1-stephen@networkplumber.org> References: <20220219234322.61309-1-stephen@networkplumber.org> <20220220005140.78713-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 rte_event_ring_free() function already handles 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