Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2650238pxj; Sun, 23 May 2021 06:45:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLPuLkWg2UYEk+8eJFyHJEzdlh4kSyDPrsj7UtXSPF5CuIvFQ9cBxKs4A9ZIBlOCFLeMtw X-Received: by 2002:a05:6e02:1252:: with SMTP id j18mr9058954ilq.205.1621777505482; Sun, 23 May 2021 06:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621777505; cv=none; d=google.com; s=arc-20160816; b=hCIJ64YGdklAY0E3g88Byqxx1Z1URQqMhlm9K7JB7lSC9Fe2c/IQTzefSud4ggMQ9Q fzgp3c4nwxrq7xZr/5i9xdDz4QsOIJSegmf1WUAFM+KQvJvorqDHzkwSRgl4H37ZeRTs T5ljmnQn+JWEMhhwzTxe1d756OCCTOf4741oMpw2TviRXZ8rA4BubCaJzyTPiP80MHQS teV0SGfWB8vAmgY6QXuWmEaj6C22ACoA98a1THCj9eRX1svgztzz6FEPWrtimjzZzDfp YHRwC+tkwob2JlSvK5buQ372r4dWtAV2lzVtVh3Lu4shxODJ5L/8OUjugstEfcY3CI7h jvGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=z9t9l6kNmtj+01PTMJwLqTTXTHr7xkZ/HuA9KXvFyOI=; b=DtK23zpkhKYoD4CCqrTIQ8pMUtBjiad5yu033TkfimpxryVr2hVZSdA6zGD1EaHNNb CgpEnZLCREUR1XGEQrAAg8Px4fFq8ZnfAwUZ6bz65LMSG3O1rKgmpiOcgCECPGrDoE8R I4DiEyUaal1scehsN8YSE5Xuv8X3Uj2b9GHGWLMPJqZn52cykwphobyIiSj3bB9pBU9V pwVz/kSGGWPgODOcLV2UJRuigULadSyJWBvgs9DAuwRmpHWnKVEPvo6xZF9FD7dXxgFw Qaf0gOqeW1E/pB/JUODC1DmaG26fiB0u3eVGGdwxH9Re+It5wzTz/S+Nbh1nMfIE5UWk AC5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=EtkwcOFM; 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 d4si11662979iow.13.2021.05.23.06.44.52; Sun, 23 May 2021 06:45:05 -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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=EtkwcOFM; 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 S231767AbhEWNok (ORCPT + 99 others); Sun, 23 May 2021 09:44:40 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:49090 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231758AbhEWNoj (ORCPT ); Sun, 23 May 2021 09:44:39 -0400 Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 94D4D2A8; Sun, 23 May 2021 15:43:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1621777391; bh=e9WKWb2u3+bpo7AIMrf2X78HJQYY6mY097rfyST6qt0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EtkwcOFMp67WVI6LFBd3yW+lKPIAfwhrC4MSKjlEWMLHuUx8hawBg3tsvh3JqcEzw C0xtWWaNK9ZcPH5e68CEvhKn+rbY9uNF+cJO2m0URx2RClftIwICJ+aUPQPLTdhvxF EZLU3wd3MJ1oGFfyt9iZJ6i3e1C/11c000aVkZzA= Date: Sun, 23 May 2021 16:43:08 +0300 From: Laurent Pinchart To: Randy Dunlap Cc: linux-kernel@vger.kernel.org, Rob Herring , Frank Rowand , devicetree@vger.kernel.org Subject: Re: [PATCH] OF: of_address: clean up OF stub functions Message-ID: References: <20210523022807.5193-1-rdunlap@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210523022807.5193-1-rdunlap@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Randy, Thank you for the patch. On Sat, May 22, 2021 at 07:28:07PM -0700, Randy Dunlap wrote: > 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 stubs. > > 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 > --- > include/linux/of_address.h | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > --- linux-next-20210521.orig/include/linux/of_address.h > +++ linux-next-20210521/include/linux/of_address.h > @@ -106,11 +106,7 @@ static inline bool of_dma_is_coherent(st > } > #endif /* CONFIG_OF_ADDRESS */ > > -#ifdef CONFIG_OF > -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 > +#if defined(CONFIG_OF) && !defined(CONFIG_OF_ADDRESS) || !defined(CONFIG_OF) Parentheses would help making the precedence order clear. On sparc, CONFIG_OF is set, CONFIG_OF_ADDRESS isn't, and of_address_to_resource() is provided by arch code. You'll stub it out here, which doesn't seem correct to me. > static inline int of_address_to_resource(struct device_node *dev, int index, > struct resource *r) > { -- Regards, Laurent Pinchart