Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp753419pxb; Wed, 29 Sep 2021 09:01:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwa6X61PKiOhzJRASmcIdhJBU5kQxE4tm2bl4LUJu6tTQvupP8a2FwRgvfta0wukq+6dKPB X-Received: by 2002:a05:600c:350f:: with SMTP id h15mr11255119wmq.144.1632931270919; Wed, 29 Sep 2021 09:01:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632931270; cv=none; d=google.com; s=arc-20160816; b=CeRjzE6qOa2oBwawqlkoYwvejbnTzQJCSZpLmuK9Mq7dD2R5WVqP41ULH42ClP34Si Xcis3/Yk9i5d7BFVwP9+ZuIygaJUCFfZg2CQhW8nPJ8qE499gjB9pPlU2fVSCV5/XSSP NvlYbfx45vFWiep3hJVWuiZr+e/IsMSOFsvviyJXDlX3ogCYqSENy66mWCdE+yuJJIKM /2vPRzaT0lnoVquJ7pDzB+VKHTq5jTM1r0N3+L474YhvG4DQoRESvhb0Nkj4Xe9BKQH+ auLJwhRcfYkOidEOEzl1xcgCjsCj69sTSDbYau6tFsOh4W37xhZsRkN5rnTq48bv6Car cjRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=JsK5x37Bqet9VuMvpkdOb11vnBJGApGPMR20FyMqy/A=; b=Fm6xvnH3Kqo7Fj2jI+MSfvs9yR+HDTAyMlBpx3tDMRDKjE0qIF2LGwCA0vNKAwa44S KDDCQ+YyQ4kG2rHlthS39ef/5jPyDV3S/qSgMhH3J0IGRoPmyQFhoNGt2GxdGghZmtYQ ykTy1IUxbQO4YLE48ZAe123Os6Rwdz3LGQTYP0NqkBxItKki/b441xg2abyFgbHyNsJA bupL31QL84fUCn4Q++ejes3z5dm8vRndsO8ACe5bgefC05Nu5iXrLlYUxZGP496WYZ4v ERGhXQLeqQUlfymTGuXxM6R2NUXS9sVRDv/D3kJN3uG59WTFtzcqqdil06dL4AZzivmb evwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OFBBzHkg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn11si253498edb.377.2021.09.29.09.00.44; Wed, 29 Sep 2021 09:01:10 -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=@kernel.org header.s=k20201202 header.b=OFBBzHkg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344894AbhI2PBZ (ORCPT + 99 others); Wed, 29 Sep 2021 11:01:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:42984 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344912AbhI2PBR (ORCPT ); Wed, 29 Sep 2021 11:01:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CBECF613A6; Wed, 29 Sep 2021 14:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632927575; bh=VUb8Hz0/BpNdgps2xTkakpwXoPg5XQy5xf84s5JEXVw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=OFBBzHkgQI9pM3LmRLhMl3lZk092dBuPGTLGeDbB7UXUbCAegu9SvLAB8mbtqxvBs 0WABJBws6oAJNxae2pQMr2F613WDHf8KuZBPs5Yqp9ZrRG0W9x7Rz6KIzmH1qV54vg GrHUMVzw23yRVOr2QRE549jZ3XdM6vWw43F9B90Hm8aIv+sYURQ5IWB/2ZAyZ5RfiM Q7u89y1ysxUuSz1bVvVBkpSNEBbn5qviU7HdodZgGVvWAz2OFbzJAp9u5RMj79/DZz pvUQDdcnoXKq+lI9zgeCcIJFmOYnbwywVysIRKGvH/mBZ82RRRbVl7lnFqXM0d2Abb qKUWIy5haa/0A== Received: by mail-ed1-f47.google.com with SMTP id v10so9866079edj.10; Wed, 29 Sep 2021 07:59:35 -0700 (PDT) X-Gm-Message-State: AOAM533U7HQ/QkJ3NRvMdtdDHql46bx66x6Jq7eBgWTeLGTZLAhjxHQh jnfxVrN5NgbhWHA043F7V7WmBluGW+RmkgeokQ== X-Received: by 2002:a17:906:c10e:: with SMTP id do14mr231513ejc.84.1632927503293; Wed, 29 Sep 2021 07:58:23 -0700 (PDT) MIME-Version: 1.0 References: <20210928201214.294737-1-trix@redhat.com> In-Reply-To: From: Rob Herring Date: Wed, 29 Sep 2021 09:58:11 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] of: remove duplicate declaration of of_iomap() To: trix@redhat.com Cc: Frank Rowand , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 29, 2021 at 9:26 AM Rob Herring wrote: > > On Tue, Sep 28, 2021 at 3:12 PM wrote: > > > > From: Tom Rix > > > > A ranconfig produces this linker error > > irq-al-fic.c:252: undefined reference to `of_iomap' > > > > The declaration of of_iomap() is dependent on OF > > The definition of of_iomap() is dependent on OF_ADDRESS > > These should match. There are duplicate declarations > > of of_iomap(), remove of_iomap() and the > > of_address_to_resource() duplicate. > > > > Signed-off-by: Tom Rix > > --- > > include/linux/of_address.h | 8 +------- > > 1 file changed, 1 insertion(+), 7 deletions(-) > > > > diff --git a/include/linux/of_address.h b/include/linux/of_address.h > > index 45598dbec269..a190996b4b0b 100644 > > --- a/include/linux/of_address.h > > +++ b/include/linux/of_address.h > > @@ -122,13 +122,7 @@ static inline bool of_dma_is_coherent(struct device_node *np) > > { > > return false; > > } > > -#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); > > This is going to break sparc which has !OF_ADDRESS and its own > of_iomap and of_address_to_resource implementations. I don't want to > add CONFIG_SPARC in here, so I think we should solve this in kconfig. > OF and !OF_ADDRESS is supposed to mean the arch provides these > functions. > > I'd really like to do away with HAS_IOMEM. It doesn't serve much > purpose other than disabling a bunch of drivers. Following UML (the only other arch with configurable HAS_IOMEM), I think dummy ioremap() implementations is the way to go here. UML added its own dummy functions, but it would be better if we can just do this: diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index e93375c710b9..a9d02403b2fe 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -946,7 +946,7 @@ static inline void *phys_to_virt(unsigned long address) * can provide stricter non-posted write semantics if the architecture * implements them. */ -#ifndef CONFIG_MMU +#if !defined(CONFIG_GENERIC_IOREMAP) #ifndef ioremap #define ioremap ioremap static inline void __iomem *ioremap(phys_addr_t offset, size_t size) @@ -961,7 +961,7 @@ static inline void iounmap(void __iomem *addr) { } #endif -#elif defined(CONFIG_GENERIC_IOREMAP) +#else /* CONFIG_GENERIC_IOREMAP */ #include void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot); @@ -972,7 +972,7 @@ static inline void __iomem *ioremap(phys_addr_t addr, size_t size) /* _PAGE_IOREMAP needs to be supplied by the architecture */ return ioremap_prot(addr, size, _PAGE_IOREMAP); } -#endif /* !CONFIG_MMU || CONFIG_GENERIC_IOREMAP */ +#endif /* CONFIG_GENERIC_IOREMAP */ #ifndef ioremap_wc #define ioremap_wc ioremap Then we can apply the following patch: diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig index 3dfeae8912df..4a2453e4d4f3 100644 --- a/drivers/of/Kconfig +++ b/drivers/of/Kconfig @@ -64,7 +64,7 @@ config OF_DYNAMIC config OF_ADDRESS def_bool y - depends on !SPARC && (HAS_IOMEM || UML) + depends on !SPARC config OF_IRQ def_bool y