From patchwork Wed Jan 27 09:26:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abaci Team X-Patchwork-Id: 12049465 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D29DAC433DB for ; Wed, 27 Jan 2021 09:27:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 52F022075B for ; Wed, 27 Jan 2021 09:27:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 52F022075B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=dq5XzgZqAB0SUPTDx3ssiqvefgz1fq3bPuejJYldWZ4=; b=yZdVhKefDCp7jOghykTnPtCGd7 bhSXjPRE52YYd3Iid667CKkQN1fL+aXJjDxK/NSDHo2YvWwYiyYyFLvcldsl2nKq4NjxSSx65YXdL uFfUe1ndNsqhlxX4wIzx6f6VfVxlPFGnEbGT9wEavZh3bMOMhpzgWJZKPEM4eovCzX2Q7fACEEB1g 3jyvEt8HYO2QG0qpF0L+3F4bzmhMn7MJdwGoOGCndCJyrd4XEtAM/bVcGHJq/XEnOXntguXExhtYb UNhMzu++UmDzuI+IhoWcI3LdlR+bYlLzngcTBfxV2LFKW1OWoiGxq+oIPNYSP6ejdBe9Rwujzknfg pwJuX1FA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4h5n-0000sS-3x; Wed, 27 Jan 2021 09:26:27 +0000 Received: from out30-43.freemail.mail.aliyun.com ([115.124.30.43]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4h5i-0000qY-IZ for linux-arm-kernel@lists.infradead.org; Wed, 27 Jan 2021 09:26:25 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R141e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04423; MF=abaci-bugfix@linux.alibaba.com; NM=1; PH=DS; RN=4; SR=0; TI=SMTPD_---0UN1hCDM_1611739567; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:abaci-bugfix@linux.alibaba.com fp:SMTPD_---0UN1hCDM_1611739567) by smtp.aliyun-inc.com(127.0.0.1); Wed, 27 Jan 2021 17:26:16 +0800 From: Abaci Team To: linux@armlinux.org.uk Subject: [PATCH] ARM: dma-mapping: remove redundant NULL check Date: Wed, 27 Jan 2021 17:26:06 +0800 Message-Id: <1611739566-121251-1-git-send-email-abaci-bugfix@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210127_042622_859721_B5E07050 X-CRM114-Status: UNSURE ( 8.81 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abaci Team MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix below warnings reported by coccicheck: ./arch/arm/common/dmabounce.c:565:2-18: WARNING: NULL check before some freeing functions is not needed. Reported-by: Abaci Robot Suggested-by: Yang Li Signed-off-by: Abaci Team --- arch/arm/common/dmabounce.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c index 7996c04..bf1218a 100644 --- a/arch/arm/common/dmabounce.c +++ b/arch/arm/common/dmabounce.c @@ -561,10 +561,8 @@ void dmabounce_unregister_dev(struct device *dev) BUG(); } - if (device_info->small.pool) - dma_pool_destroy(device_info->small.pool); - if (device_info->large.pool) - dma_pool_destroy(device_info->large.pool); + dma_pool_destroy(device_info->small.pool); + dma_pool_destroy(device_info->large.pool); #ifdef STATS if (device_info->attr_res == 0)