From: Baoquan He <bhe@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org,
akpm@linux-foundation.org, arnd@arndb.de,
jiaxun.yang@flygoat.com, mpe@ellerman.id.au,
geert@linux-m68k.org, mcgrof@kernel.org, hch@infradead.org,
tsbogend@alpha.franken.de, f.fainelli@gmail.com, deller@gmx.de,
Baoquan He <bhe@redhat.com>,
Serge Semin <fancer.lancer@gmail.com>,
Huacai Chen <chenhuacai@kernel.org>,
linux-mips@vger.kernel.org
Subject: [PATCH v5 4/4] mips: io: remove duplicated codes
Date: Thu, 21 Sep 2023 19:04:24 +0800 [thread overview]
Message-ID: <20230921110424.215592-5-bhe@redhat.com> (raw)
In-Reply-To: <20230921110424.215592-1-bhe@redhat.com>
By adding <asm-generic/io.h> support, the duplicated phys_to_virt
can be removed to use the default version in <asm-gneneric/io.h>.
Meanwhile move isa_bus_to_virt() down below <asm-generic/io.h> including
to fix the compiling error of missing phys_to_virt definition.
Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Serge Semin <fancer.lancer@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: linux-mips@vger.kernel.org
---
arch/mips/include/asm/io.h | 28 +++++-----------------------
1 file changed, 5 insertions(+), 23 deletions(-)
diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index 1ecf255efb40..fe5476c1c689 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -117,24 +117,6 @@ static inline phys_addr_t virt_to_phys(const volatile void *x)
return __virt_to_phys(x);
}
-/*
- * phys_to_virt - map physical address to virtual
- * @address: address to remap
- *
- * The returned virtual address is a current CPU mapping for
- * the memory address given. It is only valid to use this function on
- * addresses that have a kernel mapping
- *
- * This function does not handle bus mappings for DMA transfers. In
- * almost all conceivable cases a device driver should not be using
- * this function
- */
-#define phys_to_virt phys_to_virt
-static inline void * phys_to_virt(unsigned long address)
-{
- return __va(address);
-}
-
/*
* ISA I/O bus memory addresses are 1:1 with the physical address.
*/
@@ -143,11 +125,6 @@ static inline unsigned long isa_virt_to_bus(volatile void *address)
return virt_to_phys(address);
}
-static inline void *isa_bus_to_virt(unsigned long address)
-{
- return phys_to_virt(address);
-}
-
/*
* Change "struct page" to physical address.
*/
@@ -596,4 +573,9 @@ void __ioread64_copy(void *to, const void __iomem *from, size_t count);
#include <asm-generic/io.h>
+static inline void *isa_bus_to_virt(unsigned long address)
+{
+ return phys_to_virt(address);
+}
+
#endif /* _ASM_IO_H */
--
2.41.0
next prev parent reply other threads:[~2023-09-21 19:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-21 11:04 [PATCH v5 0/4] arch/*/io.h: remove ioremap_uc in some architectures Baoquan He
2023-09-21 11:04 ` [PATCH v5 1/4] video: fbdev: atyfb: only use ioremap_uc() on i386 and ia64 Baoquan He
2023-09-23 18:53 ` Helge Deller
2023-09-21 11:04 ` [PATCH v5 2/4] mips: add <asm-generic/io.h> including Baoquan He
2023-10-06 8:05 ` Thomas Bogendoerfer
2023-09-21 11:04 ` [PATCH v5 3/4] arch/*/io.h: remove ioremap_uc in some architectures Baoquan He
2023-09-21 12:27 ` Arnd Bergmann
2023-10-06 8:05 ` Thomas Bogendoerfer
2023-10-06 8:31 ` John Paul Adrian Glaubitz
2023-09-21 11:04 ` Baoquan He [this message]
2023-09-21 12:24 ` [PATCH v5 4/4] mips: io: remove duplicated codes Arnd Bergmann
2023-10-06 8:06 ` Thomas Bogendoerfer
2023-10-26 12:36 ` [PATCH v5 0/4] arch/*/io.h: remove ioremap_uc in some architectures Jiaxun Yang
2023-10-26 23:18 ` Baoquan He
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=20230921110424.215592-5-bhe@redhat.com \
--to=bhe@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=chenhuacai@kernel.org \
--cc=deller@gmx.de \
--cc=f.fainelli@gmail.com \
--cc=fancer.lancer@gmail.com \
--cc=geert@linux-m68k.org \
--cc=hch@infradead.org \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mcgrof@kernel.org \
--cc=mpe@ellerman.id.au \
--cc=tsbogend@alpha.franken.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 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).