Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3680126pxj; Mon, 24 May 2021 12:11:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAk3UnJG51CTP1xYtUrab/rzU1MCw7HE8S3mqrV3yXyyiJir0sw3gHVtGBrsnN8chZb4aW X-Received: by 2002:a17:906:2a16:: with SMTP id j22mr24682998eje.397.1621883487517; Mon, 24 May 2021 12:11:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621883487; cv=none; d=google.com; s=arc-20160816; b=uYouVbZjYSxBp10oPZy47dLEpZIcm/b+c0AeRsB8gt/kXnYlHsFCizR4S7n4v35FWR Ke6hFM6I14gvHYIlrNfubmDDC8t87jgLVbYaVHECoGdgAxk+OfB3v0ZXZrTO14cYGnC8 UkVxsTikR6D3Y15gYnroTqDDdLmfu1f0AmfMUwll0slf3Dh07vR4S8Oy9DucdIyNRMmP au6ZJRmMdacQFiw1NGi8aTWCjiqIQPg2Q3wv3Yfd25loEzDq4P69ZfCfX2X/RvJ2ZPpS ajd1vRl529aeA99/RpFCvm2mVdsOHSmP/07bcVYWUi/yaRU2zLrGxZNO9dywBvwJH51a k47w== 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=/VQWjIwAzHQh3Hpp53y0A3SY+AUfYTrfEWM/VxGYUe0=; b=jiIpxmUw/5qFGHRssdz7hXI0eErlZMHD4LEaVBCKo7X1DFD7FCacaBRtRxrymUKffF aU76JINDCckFSkoRfVS0zRHCRH0584ujHli7ldn+0tcqBFUY/FrW0gWoc5j4wU/GkgSe sdkQUazTNxXtaTYoSqt6jGc8qakx0AEW01qU0z+pgSIV/vm+txGksH6TedKt43GtFwzr Nht5aVJ6VGuWZS14rI9hTIfe2esgectY1tpF6d+750KAiaZIa8HQJ1rWb/3ykejpjAqd clBPtHzbhVI/vpbs6qm2ttSo5zRXnCPzYGWLCAcsUmXkU9td998zrHlqhmb2uXCW+cP0 av2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="Bz49qLh/"; 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 5si13710228ejw.423.2021.05.24.12.11.02; Mon, 24 May 2021 12:11:27 -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; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="Bz49qLh/"; 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 S233386AbhEXTKu (ORCPT + 99 others); Mon, 24 May 2021 15:10:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232983AbhEXTKu (ORCPT ); Mon, 24 May 2021 15:10:50 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABDC5C061574; Mon, 24 May 2021 12:09:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=/VQWjIwAzHQh3Hpp53y0A3SY+AUfYTrfEWM/VxGYUe0=; b=Bz49qLh/S2GWj6SErpe+gPEMPB 30rSJ01ZvV/reybb3yg46bz8hO8mSVIXzKsFe3yrNyWBqmms+vkYvch7fqHRlVs3FEA9awb47cQi+ ZJzfklkvYNoCEKhN6fsCiY5vVwbPoeb5PatsxyLn+H1bdZIEe9VHiqoSUtUUg6ZA2PlXYiGDaqJMs gXQgWXDpOO16N1Bi8qeQsNMcHea1ksiuiOaLPfxc6yUKzbdHXgefAyCI1ujVBpgjmhD5h327rCxtq meCroFQvcGHd/2+wpP3rr0DgcK3QXeAuijeK3hSutOJ1rH8HmcvFUsimL7DdGxyaiA7CWQlTTY/5i awse3h7A==; Received: from [2601:1c0:6280:3f0::7376] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1llFx1-001boq-QW; Mon, 24 May 2021 19:09:20 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Rob Herring , Frank Rowand , devicetree@vger.kernel.org, Laurent Pinchart , kernel test robot Subject: [PATCH v2] OF: of_address: clean up OF stub & extern functions Date: Mon, 24 May 2021 12:09:19 -0700 Message-Id: <20210524190919.2616-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adjust so that stubs are present when CONFIG_OF is not set *or* OF is set but OF_ADDRESS is not set. This eliminates 2 build errors on arch/s390/ when HAS_IOMEM is not set (so OF_ADDRESS is not set). I.e., it provides a stub for of_iomap() when one was previously not provided as well as removing some duplicate externs. s390-linux-ld: drivers/irqchip/irq-al-fic.o: in function `al_fic_init_dt': irq-al-fic.c:(.init.text+0x7a): undefined reference to `of_iomap' s390-linux-ld: drivers/clocksource/timer-of.o: in function `timer_of_init': timer-of.c:(.init.text+0xa4): undefined reference to `of_iomap' Tested with many randconfig builds, but there could still be some hidden problem here. Fixes: 4acf4b9cd453 ("of: move of_address_to_resource and of_iomap declarations from sparc") Signed-off-by: Randy Dunlap Cc: Rob Herring Cc: Frank Rowand Cc: devicetree@vger.kernel.org Cc: Laurent Pinchart Reported-by: kernel test robot --- v2: handle SPARC as a special case since it provides its own versions of of_address_to_resource() and of_iomap(); fix build errors reported by lkp/ktr and address comments from Laurent; do more randconfig build testing; include/linux/of_address.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) --- linux-next-20210524.orig/include/linux/of_address.h +++ linux-next-20210524/include/linux/of_address.h @@ -106,11 +106,12 @@ static inline bool of_dma_is_coherent(st } #endif /* CONFIG_OF_ADDRESS */ -#ifdef CONFIG_OF +#ifdef CONFIG_SPARC /* SPARC has its own versions of these */ extern int of_address_to_resource(struct device_node *dev, int index, struct resource *r); -void __iomem *of_iomap(struct device_node *node, int index); -#else +extern void __iomem *of_iomap(struct device_node *device, int index); +#else /* !CONFIG_SPARC */ +#if (defined(CONFIG_OF) && !defined(CONFIG_OF_ADDRESS)) || !defined(CONFIG_OF) static inline int of_address_to_resource(struct device_node *dev, int index, struct resource *r) { @@ -121,7 +122,9 @@ static inline void __iomem *of_iomap(str { return NULL; } -#endif +#endif /* (defined(CONFIG_OF) && !defined(CONFIG_OF_ADDRESS)) || !defined(CONFIG_OF) */ +#endif /* CONFIG_SPARC */ + #define of_range_parser_init of_pci_range_parser_init #if defined(CONFIG_OF_ADDRESS) && defined(CONFIG_PCI)