devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: linux-kernel@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH] OF: of_address: clean up OF stub functions
Date: Sun, 23 May 2021 16:43:08 +0300	[thread overview]
Message-ID: <YKpb7CBAGqpmFS7P@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20210523022807.5193-1-rdunlap@infradead.org>

Hi Randy,

Thank you for the patch.

On Sat, May 22, 2021 at 07:28:07PM -0700, Randy Dunlap wrote:
> Adjust <linux/of_address.h> 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 <rdunlap@infradead.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Frank Rowand <frowand.list@gmail.com>
> Cc: devicetree@vger.kernel.org
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  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

      parent reply	other threads:[~2021-05-23 13:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-23  2:28 [PATCH] OF: of_address: clean up OF stub functions Randy Dunlap
2021-05-23  7:49 ` kernel test robot
2021-05-23 13:43 ` Laurent Pinchart [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YKpb7CBAGqpmFS7P@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).