Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2342517rwb; Thu, 27 Jul 2023 06:02:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlH4V+eh85hdets+0XpVF7X549Zs6rim6pamGwHbF2MNVgUihNs0E1YCJhVaFWwGSKHBBZ+t X-Received: by 2002:a17:90a:1157:b0:267:a859:dfef with SMTP id d23-20020a17090a115700b00267a859dfefmr4175065pje.27.1690462960729; Thu, 27 Jul 2023 06:02:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690462960; cv=none; d=google.com; s=arc-20160816; b=G8c21c4LOJSOO4i/8w9IH5MxmH7da54IvI6lf409bmw0PVi20JCuamwHRbeZqPxqn+ Ma2AY7Wa9hJMmRN4c49XF3bk9WjHzJ3KojAZQmRURJ+xMzwe5LMeEBG85E3JKaI3KD2w GPX+HhnQqw+Y0KxzO/0ZzYUvXEatBjRM3/XsXrhAOL/7BtiW/PjLDpxbYwP32MVcXqeu wmKQymI5Sm1wG7D/vgCvFGx+hS1fW/KvmsEVyXmvOm1dDNH2ZQGE2s76VRDP2OWJ4uta dYaYTOdEbXRopDsncHU4S0pq46YcvA7AdD+WJ/wndok8DmVLlXLvEBmogHvWmPrmSKnN OpLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=jqvygROCJHo+L9Ls+k6xtykpHxPocLgiRK/DZdWEuNw=; fh=LfiYKsE4Y4Wbo6BJxeW0xMdthf4V0rcvZlkFjFk5O18=; b=LQVOb0/IPZabDVXjtq17rlIh5gYun8i1hz63vqLP5BQQTSMlsBLniH2QQov7mkO6wU hBtmKJvMhKRDgV7a37WGlozlxPR3EmJ1x+tEOZZ23r2w2IIUDo59kk5dbHw3h2f6q2uD HL72J/g0CUJIGU3Zpmlre5140mhqfd+C+zY7JkVYN7iR9iYD6KRmS/DkyaOp23/0Gii5 QsyYQTGkL41eY7iO2zpXohGdYsLBLyXFCrP4IT4732Cmgj0SolxxbumEWVmxvqd416OG xUMEjpdn+oUPPiwbYfXvdg6MEQDmb6Icprnrb9VV15l04gxde7MtoTMJ1bc431zejj83 sq0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G1IXjkAL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d92-20020a17090a6f6500b0026829e2a84bsi2880860pjk.97.2023.07.27.06.02.23; Thu, 27 Jul 2023 06:02:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G1IXjkAL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232711AbjG0M1t (ORCPT + 99 others); Thu, 27 Jul 2023 08:27:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232537AbjG0M1c (ORCPT ); Thu, 27 Jul 2023 08:27:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01DF449DD for ; Thu, 27 Jul 2023 05:26:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D1F9861E5A for ; Thu, 27 Jul 2023 12:26:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D51C7C433C8; Thu, 27 Jul 2023 12:26:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690460775; bh=27hdkgrWFVckIqtGKwcqckK1Jo4k5q7PyN7ZJPYm1Ek=; h=From:To:Cc:Subject:Date:From; b=G1IXjkALkleX4HzpP/GBUU4jC0fioQoVwq9nLLdOBjMTiQUNvINgLBZWZSKZRzFjp rPNxwdh576pES6qHQaW63U5RrOmgCMISK0DCvCcjlsS0F0CVfpmd2mvuyHNGB8lByr XJfIsEAigySm7RvZBH/ymFF5ooJ7tHkC+pqepI3potipnIRue/OQfyjH3lK2i9qOGw TTMEdeWmERD7kuxrWK/kHWbcAE8fEIeHPV8VUE7PnNQbqQsatYfsLSU+lZHaTQcLP/ OLylrNrJgkBI21vtBnota2Sd4H4ehNblQw5px/x0jcXDNPZjKeeOP3wcFTuPwxCxgM gQtvCfdH30sSw== From: Arnd Bergmann To: Michael Ellerman , Christoph Hellwig , Marek Szyprowski Cc: Arnd Bergmann , Nicholas Piggin , Christophe Leroy , Robin Murphy , Andrew Morton , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev Subject: [PATCH] dma-mapping: move arch_dma_set_mask() declaration to header Date: Thu, 27 Jul 2023 14:25:42 +0200 Message-Id: <20230727122608.2507415-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann This function has a __weak definition and an override that is only used on freescale powerpc chips. The powerpc definition however does not see the declaration that is in a .c file: arch/powerpc/kernel/dma-mask.c:7:6: error: no previous prototype for 'arch_dma_set_mask' [-Werror=missing-prototypes] Move it into the linux/dma-map-ops.h header where the other arch_dma_* functions are declared. Signed-off-by: Arnd Bergmann --- arch/powerpc/kernel/dma-mask.c | 1 + include/linux/dma-map-ops.h | 6 ++++++ kernel/dma/mapping.c | 6 ------ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/dma-mask.c b/arch/powerpc/kernel/dma-mask.c index ffbbbc4326126..5b07ca7b73aac 100644 --- a/arch/powerpc/kernel/dma-mask.c +++ b/arch/powerpc/kernel/dma-mask.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include +#include #include #include diff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h index 9bf19b5bf7559..bb5e06fd359d5 100644 --- a/include/linux/dma-map-ops.h +++ b/include/linux/dma-map-ops.h @@ -343,6 +343,12 @@ void *arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle, void arch_dma_free(struct device *dev, size_t size, void *cpu_addr, dma_addr_t dma_addr, unsigned long attrs); +#ifdef CONFIG_ARCH_HAS_DMA_SET_MASK +void arch_dma_set_mask(struct device *dev, u64 mask); +#else +#define arch_dma_set_mask(dev, mask) do { } while (0) +#endif + #ifdef CONFIG_MMU /* * Page protection so that devices that can't snoop CPU caches can use the diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index 9a4db5cce6004..e323ca48f7f2a 100644 --- a/kernel/dma/mapping.c +++ b/kernel/dma/mapping.c @@ -760,12 +760,6 @@ bool dma_pci_p2pdma_supported(struct device *dev) } EXPORT_SYMBOL_GPL(dma_pci_p2pdma_supported); -#ifdef CONFIG_ARCH_HAS_DMA_SET_MASK -void arch_dma_set_mask(struct device *dev, u64 mask); -#else -#define arch_dma_set_mask(dev, mask) do { } while (0) -#endif - int dma_set_mask(struct device *dev, u64 mask) { /* -- 2.39.2