From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 68F2EC47409 for ; Wed, 4 Dec 2019 13:03:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2EC412081B for ; Wed, 4 Dec 2019 13:03:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="naw89qSQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2EC412081B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CB6646B0AAB; Wed, 4 Dec 2019 08:03:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C90956B0AAC; Wed, 4 Dec 2019 08:03:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA3816B0AAD; Wed, 4 Dec 2019 08:03:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0150.hostedemail.com [216.40.44.150]) by kanga.kvack.org (Postfix) with ESMTP id A3F7A6B0AAB for ; Wed, 4 Dec 2019 08:03:51 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 2DD448073169 for ; Wed, 4 Dec 2019 13:03:51 +0000 (UTC) X-FDA: 76227476262.23.bread43_5b9e8060e9d09 X-HE-Tag: bread43_5b9e8060e9d09 X-Filterd-Recvd-Size: 4228 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Wed, 4 Dec 2019 13:03:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jAF0eBYW4nw9l9yTN8r13+D32W3Cf7olS+twS8QMzAQ=; b=naw89qSQQVIlhppc2EecgvCnf7 yPkAgFIug5dVwk6VjFUIGUwgvQWSrxnbuzRB8gUNPfuq+wuV655uoilf38G9WCK5Vl6J6ViO1vEp3 Xn4S2izP/OyN58/rCoU6bIlsIlwlFWPjHuU5yeNCma0jzdt0bTQWZM3NfrPafc6G5Hgssm5o2nveq DcRhURRFPB4QnuAYWs7yMoBhcPuf12y48hp1uhwVSPxJJzE8CROdQcOt+ZR+ooZgnRJaSB1uc5rp7 W6vqj2vPd1cVmgD7vDQVefyR4ZLfz0H9PMEXaPLrLX0CkP5dPTaEUd0deSbbpqACs+2sVEpYrAdFe px7WeLsg==; Received: from clnet-p19-102.ikbnet.co.at ([83.175.77.102] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1icUJl-0004AZ-2b; Wed, 04 Dec 2019 13:03:45 +0000 From: Christoph Hellwig To: Thomas Hellstrom Cc: =?UTF-8?q?Christian=20K=C3=B6nig?= , Tom Lendacky , iommu@lists.linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] dma-mapping: move dma_addressing_limited out of line Date: Wed, 4 Dec 2019 14:03:38 +0100 Message-Id: <20191204130339.22804-2-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191204130339.22804-1-hch@lst.de> References: <20191204130339.22804-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This function isn't used in the fast path, and moving it out of line will reduce include clutter with the next change. Signed-off-by: Christoph Hellwig --- include/linux/dma-mapping.h | 14 +------------- kernel/dma/mapping.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 330ad58fbf4d..be0421e570b8 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -684,19 +684,7 @@ static inline int dma_coerce_mask_and_coherent(struc= t device *dev, u64 mask) return dma_set_mask_and_coherent(dev, mask); } =20 -/** - * dma_addressing_limited - return if the device is addressing limited - * @dev: device to check - * - * Return %true if the devices DMA mask is too small to address all memo= ry in - * the system, else %false. Lack of addressing bits is the prime reason= for - * bounce buffering, but might not be the only one. - */ -static inline bool dma_addressing_limited(struct device *dev) -{ - return min_not_zero(dma_get_mask(dev), dev->bus_dma_limit) < - dma_get_required_mask(dev); -} +bool dma_addressing_limited(struct device *dev); =20 #ifdef CONFIG_ARCH_HAS_SETUP_DMA_OPS void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index 12ff766ec1fa..1dbe6d725962 100644 --- a/kernel/dma/mapping.c +++ b/kernel/dma/mapping.c @@ -405,3 +405,18 @@ unsigned long dma_get_merge_boundary(struct device *= dev) return ops->get_merge_boundary(dev); } EXPORT_SYMBOL_GPL(dma_get_merge_boundary); + +/** + * dma_addressing_limited - return if the device is addressing limited + * @dev: device to check + * + * Return %true if the devices DMA mask is too small to address all memo= ry in + * the system, else %false. Lack of addressing bits is the prime reason= for + * bounce buffering, but might not be the only one. + */ +bool dma_addressing_limited(struct device *dev) +{ + return min_not_zero(dma_get_mask(dev), dev->bus_dma_limit) < + dma_get_required_mask(dev); +} +EXPORT_SYMBOL_GPL(dma_addressing_limited); --=20 2.20.1