All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] asm-generic: Support NO_IOPORT_MAP in pci_iomap.h
@ 2022-07-22 21:22 Stafford Horne
  2022-07-29 17:04 ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Stafford Horne @ 2022-07-22 21:22 UTC (permalink / raw)
  To: LKML; +Cc: Stafford Horne, Arnd Bergmann, Bjorn Helgaas, linux-pci, linux-arch

When building OpenRISC PCI which has no ioport_map we get the following build
error.

    lib/pci_iomap.c: In function 'pci_iomap_range':
      CC      drivers/i2c/i2c-core-base.o
    ./include/asm-generic/pci_iomap.h:29:41: error: implicit declaration of function 'ioport_map'; did you mean 'ioremap'? [-Werror=implicit-function-declaration]
       29 | #define __pci_ioport_map(dev, port, nr) ioport_map((port), (nr))
          |                                         ^~~~~~~~~~
    lib/pci_iomap.c:44:24: note: in expansion of macro '__pci_ioport_map'
       44 |                 return __pci_ioport_map(dev, start, len);
          |                        ^~~~~~~~~~~~~~~~

This patch adds a NULL definition of __pci_ioport_map for architetures
which do not support ioport_map.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Stafford Horne <shorne@gmail.com>
---
The Kconfig I am using to test this is here:
  https://github.com/stffrdhrn/linux/commits/or1k-virt-4

 include/asm-generic/pci_iomap.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h
index 5a2f9bf53384..8fbb0a55545d 100644
--- a/include/asm-generic/pci_iomap.h
+++ b/include/asm-generic/pci_iomap.h
@@ -25,6 +25,8 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
 #ifdef CONFIG_NO_GENERIC_PCI_IOPORT_MAP
 extern void __iomem *__pci_ioport_map(struct pci_dev *dev, unsigned long port,
 				      unsigned int nr);
+#elif !defined(CONFIG_HAS_IOPORT_MAP)
+#define __pci_ioport_map(dev, port, nr) NULL
 #else
 #define __pci_ioport_map(dev, port, nr) ioport_map((port), (nr))
 #endif
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] asm-generic: Support NO_IOPORT_MAP in pci_iomap.h
  2022-07-22 21:22 [PATCH] asm-generic: Support NO_IOPORT_MAP in pci_iomap.h Stafford Horne
@ 2022-07-29 17:04 ` Bjorn Helgaas
  2022-07-29 20:44   ` Stafford Horne
  0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2022-07-29 17:04 UTC (permalink / raw)
  To: Stafford Horne; +Cc: LKML, Arnd Bergmann, Bjorn Helgaas, linux-pci, linux-arch

On Sat, Jul 23, 2022 at 06:22:48AM +0900, Stafford Horne wrote:
> When building OpenRISC PCI which has no ioport_map we get the following build
> error.
> 
>     lib/pci_iomap.c: In function 'pci_iomap_range':
>       CC      drivers/i2c/i2c-core-base.o
>     ./include/asm-generic/pci_iomap.h:29:41: error: implicit declaration of function 'ioport_map'; did you mean 'ioremap'? [-Werror=implicit-function-declaration]
>        29 | #define __pci_ioport_map(dev, port, nr) ioport_map((port), (nr))
>           |                                         ^~~~~~~~~~
>     lib/pci_iomap.c:44:24: note: in expansion of macro '__pci_ioport_map'
>        44 |                 return __pci_ioport_map(dev, start, len);
>           |                        ^~~~~~~~~~~~~~~~
> 
> This patch adds a NULL definition of __pci_ioport_map for architetures
> which do not support ioport_map.
> 
> Suggested-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Stafford Horne <shorne@gmail.com>

Appended to my pci/header-cleanup-immutable branch for v5.20, thanks!

> ---
> The Kconfig I am using to test this is here:
>   https://github.com/stffrdhrn/linux/commits/or1k-virt-4
> 
>  include/asm-generic/pci_iomap.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h
> index 5a2f9bf53384..8fbb0a55545d 100644
> --- a/include/asm-generic/pci_iomap.h
> +++ b/include/asm-generic/pci_iomap.h
> @@ -25,6 +25,8 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
>  #ifdef CONFIG_NO_GENERIC_PCI_IOPORT_MAP
>  extern void __iomem *__pci_ioport_map(struct pci_dev *dev, unsigned long port,
>  				      unsigned int nr);
> +#elif !defined(CONFIG_HAS_IOPORT_MAP)
> +#define __pci_ioport_map(dev, port, nr) NULL
>  #else
>  #define __pci_ioport_map(dev, port, nr) ioport_map((port), (nr))
>  #endif
> -- 
> 2.36.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] asm-generic: Support NO_IOPORT_MAP in pci_iomap.h
  2022-07-29 17:04 ` Bjorn Helgaas
@ 2022-07-29 20:44   ` Stafford Horne
  0 siblings, 0 replies; 3+ messages in thread
From: Stafford Horne @ 2022-07-29 20:44 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: LKML, Arnd Bergmann, Bjorn Helgaas, linux-pci, linux-arch

On Fri, Jul 29, 2022 at 12:04:49PM -0500, Bjorn Helgaas wrote:
> On Sat, Jul 23, 2022 at 06:22:48AM +0900, Stafford Horne wrote:
> > When building OpenRISC PCI which has no ioport_map we get the following build
> > error.
> > 
> >     lib/pci_iomap.c: In function 'pci_iomap_range':
> >       CC      drivers/i2c/i2c-core-base.o
> >     ./include/asm-generic/pci_iomap.h:29:41: error: implicit declaration of function 'ioport_map'; did you mean 'ioremap'? [-Werror=implicit-function-declaration]
> >        29 | #define __pci_ioport_map(dev, port, nr) ioport_map((port), (nr))
> >           |                                         ^~~~~~~~~~
> >     lib/pci_iomap.c:44:24: note: in expansion of macro '__pci_ioport_map'
> >        44 |                 return __pci_ioport_map(dev, start, len);
> >           |                        ^~~~~~~~~~~~~~~~
> > 
> > This patch adds a NULL definition of __pci_ioport_map for architetures
> > which do not support ioport_map.
> > 
> > Suggested-by: Arnd Bergmann <arnd@arndb.de>
> > Signed-off-by: Stafford Horne <shorne@gmail.com>
> 
> Appended to my pci/header-cleanup-immutable branch for v5.20, thanks!

Thanks, I did have this in the PCI series on my OpenRISC fot-next branch.  I
will just rebase that on the pci/header-cleanup-immutable branch to avoid having
the patch there two times.

Also, your updated subject on the commit is much better.

-Stafford

> > ---
> > The Kconfig I am using to test this is here:
> >   https://github.com/stffrdhrn/linux/commits/or1k-virt-4
> > 
> >  include/asm-generic/pci_iomap.h | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h
> > index 5a2f9bf53384..8fbb0a55545d 100644
> > --- a/include/asm-generic/pci_iomap.h
> > +++ b/include/asm-generic/pci_iomap.h
> > @@ -25,6 +25,8 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
> >  #ifdef CONFIG_NO_GENERIC_PCI_IOPORT_MAP
> >  extern void __iomem *__pci_ioport_map(struct pci_dev *dev, unsigned long port,
> >  				      unsigned int nr);
> > +#elif !defined(CONFIG_HAS_IOPORT_MAP)
> > +#define __pci_ioport_map(dev, port, nr) NULL
> >  #else
> >  #define __pci_ioport_map(dev, port, nr) ioport_map((port), (nr))
> >  #endif
> > -- 
> > 2.36.1
> > 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-29 20:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-22 21:22 [PATCH] asm-generic: Support NO_IOPORT_MAP in pci_iomap.h Stafford Horne
2022-07-29 17:04 ` Bjorn Helgaas
2022-07-29 20:44   ` Stafford Horne

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.