linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de,
	mpe@ellerman.id.au, geert@linux-m68k.org, mcgrof@kernel.org,
	hch@infradead.org, Baoquan He <bhe@redhat.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Helge Deller <deller@gmx.de>,
	Serge Semin <fancer.lancer@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Huacai Chen <chenhuacai@kernel.org>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	linux-mips@vger.kernel.org
Subject: [PATCH v4 4/4] mips: io: remove duplicated codes
Date: Wed,  8 Mar 2023 21:07:10 +0800	[thread overview]
Message-ID: <20230308130710.368085-5-bhe@redhat.com> (raw)
In-Reply-To: <20230308130710.368085-1-bhe@redhat.com>

By adding asm-generic/io.h support, there are some duplicated function
implementation, like phys_to_virt, memset_io, memcpy_(from|to)io.
Let's remove them to use the default version in asm-neneric/io.h.

Meanwhile move isa_bus_to_virt() down below <asm-generic/io.h> including
line 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 | 45 +++++---------------------------------
 1 file changed, 5 insertions(+), 40 deletions(-)

diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index da0a625c3c6d..1b38f02bc608 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -114,24 +114,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.
  */
@@ -140,11 +122,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.
  */
@@ -535,23 +512,6 @@ BUILDSTRING(q, u64)
 #define writesq writesq
 #endif
 
-
-#define memset_io memset_io
-static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count)
-{
-	memset((void __force *) addr, val, count);
-}
-#define memcpy_fromio memcpy_fromio
-static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
-{
-	memcpy(dst, (void __force *) src, count);
-}
-#define memcpy_toio memcpy_toio
-static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int count)
-{
-	memcpy((void __force *) dst, src, count);
-}
-
 /*
  * The caches on some architectures aren't dma-coherent and have need to
  * handle this in software.  There are three types of operations that
@@ -617,4 +577,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.34.1



      parent reply	other threads:[~2023-03-08 13:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08 13:07 [PATCH v4 0/4] arch/*/io.h: remove ioremap_uc in some architectures Baoquan He
2023-03-08 13:07 ` [PATCH v4 1/4] video: fbdev: atyfb: only use ioremap_uc() on i386 and ia64 Baoquan He
2023-03-08 20:01   ` Luis Chamberlain
2023-03-08 21:34     ` Arnd Bergmann
2023-03-08 21:49       ` Helge Deller
2023-03-08 22:48     ` Ondrej Zary
2023-03-08 13:07 ` [PATCH v4 2/4] mips: add <asm-generic/io.h> including Baoquan He
2023-03-13 17:55   ` Thomas Bogendoerfer
2023-03-14  2:56     ` Baoquan He
2023-03-14 15:34       ` Thomas Bogendoerfer
2023-03-14 16:31         ` Florian Fainelli
2023-03-14 17:19           ` Arnd Bergmann
2023-03-15  0:49             ` Baoquan He
2023-03-15 12:52               ` Thomas Bogendoerfer
2023-03-08 13:07 ` [PATCH v4 3/4] arch/*/io.h: remove ioremap_uc in some architectures Baoquan He
2023-03-09 14:36   ` Thomas Bogendoerfer
2023-03-10  1:45     ` Baoquan He
2023-03-10 21:14       ` Helge Deller
2023-03-09 22:54   ` Michael Ellerman
2023-03-08 13:07 ` Baoquan He [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=20230308130710.368085-5-bhe@redhat.com \
    --to=bhe@redhat.com \
    --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