lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqKMLu1Vm1x0rVGXf-RD2Mw65f3YPY3QL1mEB8=CQ9GMGw@mail.gmail.com>
Date:   Wed, 29 Sep 2021 09:26:05 -0500
From:   Rob Herring <robh+dt@...nel.org>
To:     trix@...hat.com
Cc:     Frank Rowand <frowand.list@...il.com>, devicetree@...r.kernel.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] of: remove duplicate declaration of of_iomap()

On Tue, Sep 28, 2021 at 3:12 PM <trix@...hat.com> wrote:
>
> From: Tom Rix <trix@...hat.com>
>
> 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 <trix@...hat.com>
> ---
>  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.

> -#else
>  static inline int of_address_to_resource(struct device_node *dev, int index,
>                                          struct resource *r)
>  {
> @@ -139,7 +133,7 @@ static inline void __iomem *of_iomap(struct device_node *device, int index)
>  {
>         return NULL;
>  }
> -#endif
> +#endif /* CONFIG_OF_ADDRESS */
>  #define of_range_parser_init of_pci_range_parser_init
>
>  static inline const __be32 *of_get_address(struct device_node *dev, int index,
> --
> 2.26.3
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ