Skip to content

Commit 41c8992

Browse files
mpemaddy-kerneldev
authored andcommitted
powerpc/io: Remove unnecessary indirection
Some of the __do_xxx() defines do nothing useful, they just existed to make the previous hooking macros work. So remove them. Reviewed-by: Arnd Bergmann <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Signed-off-by: Madhavan Srinivasan <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 15efd61 commit 41c8992

File tree

1 file changed

+9
-21
lines changed
  • arch/powerpc/include/asm

1 file changed

+9
-21
lines changed

arch/powerpc/include/asm/io.h

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -505,13 +505,6 @@ __do_out_asm(_rec_outl, "stwbrx")
505505
* possible to hook directly at the toplevel PIO operation if they have to
506506
* be handled differently
507507
*/
508-
#define __do_writeb(val, addr) out_8(addr, val)
509-
#define __do_writew(val, addr) out_le16(addr, val)
510-
#define __do_writel(val, addr) out_le32(addr, val)
511-
#define __do_writeq(val, addr) out_le64(addr, val)
512-
#define __do_writew_be(val, addr) out_be16(addr, val)
513-
#define __do_writel_be(val, addr) out_be32(addr, val)
514-
#define __do_writeq_be(val, addr) out_be64(addr, val)
515508

516509
#ifdef CONFIG_EEH
517510
#define __do_readb(addr) eeh_readb(addr)
@@ -567,11 +560,6 @@ __do_out_asm(_rec_outl, "stwbrx")
567560
#define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)(_IO_BASE+(p)),(b),(n))
568561
#define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)(_IO_BASE+(p)),(b),(n))
569562

570-
#define __do_memset_io(addr, c, n) \
571-
_memset_io(addr, c, n)
572-
#define __do_memcpy_toio(dst, src, n) \
573-
_memcpy_toio(dst, src, n)
574-
575563
#ifdef CONFIG_EEH
576564
#define __do_memcpy_fromio(dst, src, n) \
577565
eeh_memcpy_fromio(dst, src, n)
@@ -610,30 +598,30 @@ static inline u32 readl_be(const PCI_IO_ADDR addr)
610598

611599
static inline void writeb(u8 val, PCI_IO_ADDR addr)
612600
{
613-
__do_writeb(val, addr);
601+
out_8(addr, val);
614602
}
615603
#define writeb writeb
616604

617605
static inline void writew(u16 val, PCI_IO_ADDR addr)
618606
{
619-
__do_writew(val, addr);
607+
out_le16(addr, val);
620608
}
621609
#define writew writew
622610

623611
static inline void writel(u32 val, PCI_IO_ADDR addr)
624612
{
625-
__do_writel(val, addr);
613+
out_le32(addr, val);
626614
}
627615
#define writel writel
628616

629617
static inline void writew_be(u16 val, PCI_IO_ADDR addr)
630618
{
631-
__do_writew_be(val, addr);
619+
out_be16(addr, val);
632620
}
633621

634622
static inline void writel_be(u32 val, PCI_IO_ADDR addr)
635623
{
636-
__do_writel_be(val, addr);
624+
out_be32(addr, val);
637625
}
638626

639627
static inline void readsb(const PCI_IO_ADDR a, void *b, unsigned long c)
@@ -674,7 +662,7 @@ static inline void writesl(PCI_IO_ADDR a, const void *b, unsigned long c)
674662

675663
static inline void memset_io(PCI_IO_ADDR a, int c, unsigned long n)
676664
{
677-
__do_memset_io(a, c, n);
665+
_memset_io(a, c, n);
678666
}
679667
#define memset_io memset_io
680668

@@ -686,7 +674,7 @@ static inline void memcpy_fromio(void *d, const PCI_IO_ADDR s, unsigned long n)
686674

687675
static inline void memcpy_toio(PCI_IO_ADDR d, const void *s, unsigned long n)
688676
{
689-
__do_memcpy_toio(d, s, n);
677+
_memcpy_toio(d, s, n);
690678
}
691679
#define memcpy_toio memcpy_toio
692680

@@ -703,12 +691,12 @@ static inline u64 readq_be(const PCI_IO_ADDR addr)
703691

704692
static inline void writeq(u64 val, PCI_IO_ADDR addr)
705693
{
706-
__do_writeq(val, addr);
694+
out_le64(addr, val);
707695
}
708696

709697
static inline void writeq_be(u64 val, PCI_IO_ADDR addr)
710698
{
711-
__do_writeq_be(val, addr);
699+
out_be64(addr, val);
712700
}
713701
#endif /* __powerpc64__ */
714702

0 commit comments

Comments
 (0)