All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chunyan Zhang <zhang.lyra@gmail.com>
To: Vasily Gorbik <gor@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Sebastian Ott <sebott@linux.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: linux-s390@vger.kernel.org, kernel test robot <lkp@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Chunyan Zhang <chunyan.zhang@unisoc.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] s390/io: Fix ioremap and iounmap undefinded issue for s390
Date: Fri,  3 Sep 2021 15:56:41 +0800	[thread overview]
Message-ID: <20210903075641.2807623-1-zhang.lyra@gmail.com> (raw)

From: Chunyan Zhang <chunyan.zhang@unisoc.com>

There would not be ioremap and iounmap implementations if CONFIG_PCI is
not set for s390, so add default declarations of these two functionsi
for the case to avoid 'undefined reference' issue.

Fixes: 71ba41c9b1d9 ("s390/pci: provide support for MIO instructions")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
---
The issue was reported from https://lkml.org/lkml/2021/8/1/18
---
 arch/s390/include/asm/io.h | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/s390/include/asm/io.h b/arch/s390/include/asm/io.h
index e3882b012bfa..9438370c6445 100644
--- a/arch/s390/include/asm/io.h
+++ b/arch/s390/include/asm/io.h
@@ -23,11 +23,8 @@ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
 #define IO_SPACE_LIMIT 0
 
 void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot);
-void __iomem *ioremap(phys_addr_t addr, size_t size);
 void __iomem *ioremap_wc(phys_addr_t addr, size_t size);
 void __iomem *ioremap_wt(phys_addr_t addr, size_t size);
-void iounmap(volatile void __iomem *addr);
-
 static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
 {
 	return NULL;
@@ -39,6 +36,9 @@ static inline void ioport_unmap(void __iomem *p)
 
 #ifdef CONFIG_PCI
 
+void __iomem *ioremap(phys_addr_t addr, size_t size);
+void iounmap(volatile void __iomem *addr);
+
 /*
  * s390 needs a private implementation of pci_iomap since ioremap with its
  * offset parameter isn't sufficient. That's because BAR spaces are not
@@ -70,6 +70,15 @@ static inline void ioport_unmap(void __iomem *p)
 #define __raw_writel	zpci_write_u32
 #define __raw_writeq	zpci_write_u64
 
+#else
+static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
+{
+	return (void __iomem *) offset;
+}
+
+static inline void iounmap(void __iomem *addr)
+{
+}
 #endif /* CONFIG_PCI */
 
 #include <asm-generic/io.h>
-- 
2.25.1


             reply	other threads:[~2021-09-03  7:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03  7:56 Chunyan Zhang [this message]
2021-09-03  8:03 ` [PATCH] s390/io: Fix ioremap and iounmap undefinded issue for s390 Chunyan Zhang
2021-09-03  8:24   ` Niklas Schnelle
2021-09-03  9:40     ` Chunyan Zhang
2021-09-03 10:28       ` Niklas Schnelle
2021-09-03 10:51         ` Heiko Carstens

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=20210903075641.2807623-1-zhang.lyra@gmail.com \
    --to=zhang.lyra@gmail.com \
    --cc=borntraeger@de.ibm.com \
    --cc=chunyan.zhang@unisoc.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=sebott@linux.ibm.com \
    --cc=tglx@linutronix.de \
    /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 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.