Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1539517ybt; Thu, 9 Jul 2020 09:20:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyu94j00oowppgFC2s92hXiHRoZ8roo/xVDAXEzXEiiyujSFFkUxXDXEpEWm4XCT4j6Gr5 X-Received: by 2002:a17:906:cc0e:: with SMTP id ml14mr55821584ejb.432.1594311625705; Thu, 09 Jul 2020 09:20:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594311625; cv=none; d=google.com; s=arc-20160816; b=Jt/5DmOGpcVV8h2Gr6gS5rZGgHyLNDmnZ+FQ+4Nqu6DTZsCKn27ghjSIwP8Y/PEoTu vRcdUQF1ZIgASpE/795LHzpnz7RqBJPdB7NSzaxJPO7K5vpuSkn77M4DpD6oRqdjtudD S5Bqd5TzBZoJi2o7/OTH/S/8H6/QfEW7DSH5RQF7v/eCD0TImiwuUyxOo5gOm2wkypTt bcXv5Iwz9SA/RfWbjFQnxRTumh3MW/gD0NBc5+Drw07vEu+zctIGxU3vyvZRni6+UZeQ OCorqHDbnsQPvFFGmHT9Z3TxDCn2MtVPuixHhWZF1+HZbgJzDlzPeqO3Ml6VhUt0Uk9o eTuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=mSy1zXT7q1KeMl4CDfX1oiZ9lvDeT0xoVCCz+D5NGds=; b=ZBuHJAN6Nuv1EI/ECeQZ7zkMtGdsIwrvsdZS9+rlHIGG7/5rb21Svtua7D2ifs5hpt jA4SeiwRq6Ym8JLLqDPDnUOyDHSKGWuEnZq3G0QqpUebbG/zDJtbszDoOEFcht5SasNT f2op7af0mnr09fnTLzivHqfTZygfwmxsrFV+CamLhSypZJoFBsPQVIeDneXMTAeKepsg 5mPzG/ztncej9A+HmPK/im+K8tsEeGIZA1ExYHdHmCiEb0l/xdEmyGZhwUXwU/cs3AJn K49C8WT3tkVtnzkLs9E4zMtW4g1bUmqUIy+f3WvlOtRR+UqClCblj4qUb9wc/TudydDl rizw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ni7si1973710ejb.725.2020.07.09.09.20.03; Thu, 09 Jul 2020 09:20:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728246AbgGIQTg (ORCPT + 99 others); Thu, 9 Jul 2020 12:19:36 -0400 Received: from mx2.suse.de ([195.135.220.15]:39124 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727952AbgGIQTe (ORCPT ); Thu, 9 Jul 2020 12:19:34 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3B598AEBE; Thu, 9 Jul 2020 16:19:33 +0000 (UTC) From: Nicolas Saenz Julienne To: hch@lst.de, Robin Murphy , David Rientjes , iommu@lists.linux-foundation.org, Marek Szyprowski Cc: linux-rpi-kernel@lists.infradead.org, jeremy.linton@arm.com, Nicolas Saenz Julienne , linux-kernel@vger.kernel.org Subject: [PATCH 2/4] dma-pool: Get rid of dma_in_atomic_pool() Date: Thu, 9 Jul 2020 18:19:02 +0200 Message-Id: <20200709161903.26229-3-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200709161903.26229-1-nsaenzjulienne@suse.de> References: <20200709161903.26229-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function is only used once and can be simplified to a one-liner. Signed-off-by: Nicolas Saenz Julienne --- kernel/dma/pool.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c index 8cfa01243ed2..7363640fc91c 100644 --- a/kernel/dma/pool.c +++ b/kernel/dma/pool.c @@ -217,15 +217,6 @@ static inline struct gen_pool *dev_to_pool(struct device *dev) return atomic_pool_kernel; } -static bool dma_in_atomic_pool(struct device *dev, void *start, size_t size) -{ - struct gen_pool *pool = dev_to_pool(dev); - - if (unlikely(!pool)) - return false; - return gen_pool_has_addr(pool, (unsigned long)start, size); -} - void *dma_alloc_from_pool(struct device *dev, size_t size, struct page **ret_page, gfp_t flags) { @@ -256,7 +247,7 @@ bool dma_free_from_pool(struct device *dev, void *start, size_t size) { struct gen_pool *pool = dev_to_pool(dev); - if (!dma_in_atomic_pool(dev, start, size)) + if (!pool || !gen_pool_has_addr(pool, (unsigned long)start, size)) return false; gen_pool_free(pool, (unsigned long)start, size); return true; -- 2.27.0