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 C9FDFA04A6; Mon, 24 Jan 2022 01:07:15 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC5ED42823; Mon, 24 Jan 2022 01:05:45 +0100 (CET) Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by mails.dpdk.org (Postfix) with ESMTP id 7EB73427B4 for ; Mon, 24 Jan 2022 01:05:42 +0100 (CET) Received: by mail-pg1-f182.google.com with SMTP id 187so13438573pga.10 for ; Sun, 23 Jan 2022 16:05:42 -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=h7EyV8cgqNiWY7nRhIizAuJh6uZENLxeigzoOpNoMSk=; b=Urs46/e9Z4VGUtpyt8qGzCr7OnbUv4mEUFdfSegpTfAGRXAnOGEEAkLW/JMm32IXvn FDAwowDy86fL2Gyll7uKKxfLedVOS+J5AdPE0zNWFmQWFuXOBIhPpeSL5PnAvWxJU+++ e/b+9Gx+7Wf0Ff3lo+dZPIEa02ERade+JLDlqoSrUSpM4XbnZ2cqsumzZoqfGmRvK14p ll4A4UtXBYZBLyOnwX/LCff96UUWSDyvVt04VLF50m5DVRKEGJM+DSyfKQvW0vSaW0Qy mJLvDjpH7GhclLOn+QpQbmF3v10FuCsUMQVXvY83ru7frMQUJJaH74qnEWO61kp894wn b23A== 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=h7EyV8cgqNiWY7nRhIizAuJh6uZENLxeigzoOpNoMSk=; b=sh3mxIcBCluvdYNKqRpgnF/OYmoYhic4nqVVU7Alry6T5nkE40phjgpVmzCoevMGmp dayt1z5n85jV/TiMAF7twosd+8tIduUBTXdAZNtqq0WbbE5IpC0hHY6r2Iv8c0Iq1qXp 6snj75ZG0ZIw0yprFzFztQkp/x3xl0w1YF6dtjVdfQlitsWoc9TTFxnjMJpIly1XelxW px8qjihpIJapN79FID3vYDVTgMjggdavsCgkEGLLontk73ZYmeSE9qP0t03ntB6U6j8R pITgjft1/VEEfec7ANg8+k2KcZGrm092ubaXIrJUaXmpLbrYXw4rdTCG82qaKd2bujnR o69g== X-Gm-Message-State: AOAM530le6iTDPoWIl6MJkRwvL6ao959Vo8bkZMMliaNFX9GxF0tfrSX x7Pvs1KX2hmhISzq/waVYeBR6eNkzhyu7w== X-Google-Smtp-Source: ABdhPJxm17D7/Af8Fmxnla3wBOVylFHli1KSsPFEnSpKvmMQwEgyKFu9RyBGrdYdMIIbJHaIvWqq4Q== X-Received: by 2002:a05:6a00:21c2:b0:4bc:fb2d:4b6f with SMTP id t2-20020a056a0021c200b004bcfb2d4b6fmr11827978pfj.62.1642982741510; Sun, 23 Jan 2022 16:05:41 -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.05.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:05:41 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Hemant Agrawal , Sachin Saxena Subject: [PATCH 19/82] bus/fslmc: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:04:15 -0800 Message-Id: <20220124000518.319850-20-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/bus/fslmc/fslmc_bus.c | 6 ++---- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index 53fd75539e98..30d019516b91 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -223,13 +223,11 @@ scan_one_fslmc_device(char *dev_name) insert_in_device_list(dev); /* Don't need the duplicated device filesystem entry anymore */ - if (dup_dev_name) - free(dup_dev_name); + free(dup_dev_name); return 0; cleanup: - if (dup_dev_name) - free(dup_dev_name); + free(dup_dev_name); if (dev) { rte_intr_instance_free(dev->intr_handle); free(dev); diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index 52605ea2c32c..943fadee4816 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -149,8 +149,7 @@ dpaa2_affine_dpio_intr_to_respective_core(int32_t dpio_id, int cpu_id) if (!token) { DPAA2_BUS_WARN("Failed to get interrupt id for dpio.%d", dpio_id); - if (temp) - free(temp); + free(temp); fclose(file); return; } @@ -574,8 +573,7 @@ dpaa2_free_dq_storage(struct queue_storage_info_t *q_storage) int i = 0; for (i = 0; i < NUM_DQS_PER_QUEUE; i++) { - if (q_storage->dq_storage[i]) - rte_free(q_storage->dq_storage[i]); + rte_free(q_storage->dq_storage[i]); } } -- 2.30.2