Skip to content

Commit e7bc47b

Browse files
committed
s390: Stop using weak symbols for __iowrite64_copy()
Complete switching the __iowriteXX_copy() routines over to use #define and arch provided inline/macro functions instead of weak symbols. S390 has an implementation that simply calls another memcpy function. Inline this so the callers don't have to do two jumps. Link: https://lore.kernel.org/r/[email protected] Acked-by: Niklas Schnelle <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 6ae798c commit e7bc47b

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

arch/s390/include/asm/io.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ static inline void __iowrite32_copy(void __iomem *to, const void *from,
8181
}
8282
#define __iowrite32_copy __iowrite32_copy
8383

84+
static inline void __iowrite64_copy(void __iomem *to, const void *from,
85+
size_t count)
86+
{
87+
zpci_memcpy_toio(to, from, count * 8);
88+
}
89+
#define __iowrite64_copy __iowrite64_copy
90+
8491
#endif /* CONFIG_PCI */
8592

8693
#include <asm-generic/io.h>

arch/s390/pci/pci.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,6 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
250250
return 0;
251251
}
252252

253-
/* combine single writes by using store-block insn */
254-
void __iowrite64_copy(void __iomem *to, const void *from, size_t count)
255-
{
256-
zpci_memcpy_toio(to, from, count * 8);
257-
}
258-
259253
void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size,
260254
unsigned long prot)
261255
{

include/linux/io.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ void __iowrite32_copy(void __iomem *to, const void *from, size_t count);
2121
#endif
2222

2323
void __ioread32_copy(void *to, const void __iomem *from, size_t count);
24+
25+
#ifndef __iowrite64_copy
2426
void __iowrite64_copy(void __iomem *to, const void *from, size_t count);
27+
#endif
2528

2629
#ifdef CONFIG_MMU
2730
int ioremap_page_range(unsigned long addr, unsigned long end,

lib/iomap_copy.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ EXPORT_SYMBOL_GPL(__ioread32_copy);
6060
* time. Order of access is not guaranteed, nor is a memory barrier
6161
* performed afterwards.
6262
*/
63-
void __attribute__((weak)) __iowrite64_copy(void __iomem *to,
64-
const void *from,
65-
size_t count)
63+
#ifndef __iowrite64_copy
64+
void __iowrite64_copy(void __iomem *to, const void *from, size_t count)
6665
{
6766
#ifdef CONFIG_64BIT
6867
u64 __iomem *dst = to;
@@ -75,5 +74,5 @@ void __attribute__((weak)) __iowrite64_copy(void __iomem *to,
7574
__iowrite32_copy(to, from, count * 2);
7675
#endif
7776
}
78-
7977
EXPORT_SYMBOL_GPL(__iowrite64_copy);
78+
#endif

0 commit comments

Comments
 (0)