Skip to content

Commit de9cc05

Browse files
mpemaddy-kerneldev
authored andcommitted
powerpc/io: Remove PCI_FIX_ADDR
Now that PPC_INDIRECT_MMIO is removed, PCI_FIX_ADDR does nothing, so remove it. Acked-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 6584845 commit de9cc05

File tree

2 files changed

+43
-45
lines changed

2 files changed

+43
-45
lines changed

arch/powerpc/include/asm/io.h

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -277,58 +277,56 @@ extern void _memcpy_toio(volatile void __iomem *dest, const void *src,
277277
/* Shortcut to the MMIO argument pointer */
278278
#define PCI_IO_ADDR volatile void __iomem *
279279

280-
#define PCI_FIX_ADDR(addr) (addr)
281-
282280
/*
283281
* Non ordered and non-swapping "raw" accessors
284282
*/
285283

286284
static inline unsigned char __raw_readb(const volatile void __iomem *addr)
287285
{
288-
return *(volatile unsigned char __force *)PCI_FIX_ADDR(addr);
286+
return *(volatile unsigned char __force *)addr;
289287
}
290288
#define __raw_readb __raw_readb
291289

292290
static inline unsigned short __raw_readw(const volatile void __iomem *addr)
293291
{
294-
return *(volatile unsigned short __force *)PCI_FIX_ADDR(addr);
292+
return *(volatile unsigned short __force *)addr;
295293
}
296294
#define __raw_readw __raw_readw
297295

298296
static inline unsigned int __raw_readl(const volatile void __iomem *addr)
299297
{
300-
return *(volatile unsigned int __force *)PCI_FIX_ADDR(addr);
298+
return *(volatile unsigned int __force *)addr;
301299
}
302300
#define __raw_readl __raw_readl
303301

304302
static inline void __raw_writeb(unsigned char v, volatile void __iomem *addr)
305303
{
306-
*(volatile unsigned char __force *)PCI_FIX_ADDR(addr) = v;
304+
*(volatile unsigned char __force *)addr = v;
307305
}
308306
#define __raw_writeb __raw_writeb
309307

310308
static inline void __raw_writew(unsigned short v, volatile void __iomem *addr)
311309
{
312-
*(volatile unsigned short __force *)PCI_FIX_ADDR(addr) = v;
310+
*(volatile unsigned short __force *)addr = v;
313311
}
314312
#define __raw_writew __raw_writew
315313

316314
static inline void __raw_writel(unsigned int v, volatile void __iomem *addr)
317315
{
318-
*(volatile unsigned int __force *)PCI_FIX_ADDR(addr) = v;
316+
*(volatile unsigned int __force *)addr = v;
319317
}
320318
#define __raw_writel __raw_writel
321319

322320
#ifdef __powerpc64__
323321
static inline unsigned long __raw_readq(const volatile void __iomem *addr)
324322
{
325-
return *(volatile unsigned long __force *)PCI_FIX_ADDR(addr);
323+
return *(volatile unsigned long __force *)addr;
326324
}
327325
#define __raw_readq __raw_readq
328326

329327
static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr)
330328
{
331-
*(volatile unsigned long __force *)PCI_FIX_ADDR(addr) = v;
329+
*(volatile unsigned long __force *)addr = v;
332330
}
333331
#define __raw_writeq __raw_writeq
334332

@@ -507,30 +505,30 @@ __do_out_asm(_rec_outl, "stwbrx")
507505
* possible to hook directly at the toplevel PIO operation if they have to
508506
* be handled differently
509507
*/
510-
#define __do_writeb(val, addr) out_8(PCI_FIX_ADDR(addr), val)
511-
#define __do_writew(val, addr) out_le16(PCI_FIX_ADDR(addr), val)
512-
#define __do_writel(val, addr) out_le32(PCI_FIX_ADDR(addr), val)
513-
#define __do_writeq(val, addr) out_le64(PCI_FIX_ADDR(addr), val)
514-
#define __do_writew_be(val, addr) out_be16(PCI_FIX_ADDR(addr), val)
515-
#define __do_writel_be(val, addr) out_be32(PCI_FIX_ADDR(addr), val)
516-
#define __do_writeq_be(val, addr) out_be64(PCI_FIX_ADDR(addr), val)
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)
517515

518516
#ifdef CONFIG_EEH
519-
#define __do_readb(addr) eeh_readb(PCI_FIX_ADDR(addr))
520-
#define __do_readw(addr) eeh_readw(PCI_FIX_ADDR(addr))
521-
#define __do_readl(addr) eeh_readl(PCI_FIX_ADDR(addr))
522-
#define __do_readq(addr) eeh_readq(PCI_FIX_ADDR(addr))
523-
#define __do_readw_be(addr) eeh_readw_be(PCI_FIX_ADDR(addr))
524-
#define __do_readl_be(addr) eeh_readl_be(PCI_FIX_ADDR(addr))
525-
#define __do_readq_be(addr) eeh_readq_be(PCI_FIX_ADDR(addr))
517+
#define __do_readb(addr) eeh_readb(addr)
518+
#define __do_readw(addr) eeh_readw(addr)
519+
#define __do_readl(addr) eeh_readl(addr)
520+
#define __do_readq(addr) eeh_readq(addr)
521+
#define __do_readw_be(addr) eeh_readw_be(addr)
522+
#define __do_readl_be(addr) eeh_readl_be(addr)
523+
#define __do_readq_be(addr) eeh_readq_be(addr)
526524
#else /* CONFIG_EEH */
527-
#define __do_readb(addr) in_8(PCI_FIX_ADDR(addr))
528-
#define __do_readw(addr) in_le16(PCI_FIX_ADDR(addr))
529-
#define __do_readl(addr) in_le32(PCI_FIX_ADDR(addr))
530-
#define __do_readq(addr) in_le64(PCI_FIX_ADDR(addr))
531-
#define __do_readw_be(addr) in_be16(PCI_FIX_ADDR(addr))
532-
#define __do_readl_be(addr) in_be32(PCI_FIX_ADDR(addr))
533-
#define __do_readq_be(addr) in_be64(PCI_FIX_ADDR(addr))
525+
#define __do_readb(addr) in_8(addr)
526+
#define __do_readw(addr) in_le16(addr)
527+
#define __do_readl(addr) in_le32(addr)
528+
#define __do_readq(addr) in_le64(addr)
529+
#define __do_readw_be(addr) in_be16(addr)
530+
#define __do_readl_be(addr) in_be32(addr)
531+
#define __do_readq_be(addr) in_be64(addr)
534532
#endif /* !defined(CONFIG_EEH) */
535533

536534
#ifdef CONFIG_PPC32
@@ -550,17 +548,17 @@ __do_out_asm(_rec_outl, "stwbrx")
550548
#endif /* !CONFIG_PPC32 */
551549

552550
#ifdef CONFIG_EEH
553-
#define __do_readsb(a, b, n) eeh_readsb(PCI_FIX_ADDR(a), (b), (n))
554-
#define __do_readsw(a, b, n) eeh_readsw(PCI_FIX_ADDR(a), (b), (n))
555-
#define __do_readsl(a, b, n) eeh_readsl(PCI_FIX_ADDR(a), (b), (n))
551+
#define __do_readsb(a, b, n) eeh_readsb(a, (b), (n))
552+
#define __do_readsw(a, b, n) eeh_readsw(a, (b), (n))
553+
#define __do_readsl(a, b, n) eeh_readsl(a, (b), (n))
556554
#else /* CONFIG_EEH */
557-
#define __do_readsb(a, b, n) _insb(PCI_FIX_ADDR(a), (b), (n))
558-
#define __do_readsw(a, b, n) _insw(PCI_FIX_ADDR(a), (b), (n))
559-
#define __do_readsl(a, b, n) _insl(PCI_FIX_ADDR(a), (b), (n))
555+
#define __do_readsb(a, b, n) _insb(a, (b), (n))
556+
#define __do_readsw(a, b, n) _insw(a, (b), (n))
557+
#define __do_readsl(a, b, n) _insl(a, (b), (n))
560558
#endif /* !CONFIG_EEH */
561-
#define __do_writesb(a, b, n) _outsb(PCI_FIX_ADDR(a),(b),(n))
562-
#define __do_writesw(a, b, n) _outsw(PCI_FIX_ADDR(a),(b),(n))
563-
#define __do_writesl(a, b, n) _outsl(PCI_FIX_ADDR(a),(b),(n))
559+
#define __do_writesb(a, b, n) _outsb(a, (b), (n))
560+
#define __do_writesw(a, b, n) _outsw(a, (b), (n))
561+
#define __do_writesl(a, b, n) _outsl(a, (b), (n))
564562

565563
#define __do_insb(p, b, n) readsb((PCI_IO_ADDR)(_IO_BASE+(p)), (b), (n))
566564
#define __do_insw(p, b, n) readsw((PCI_IO_ADDR)(_IO_BASE+(p)), (b), (n))
@@ -570,16 +568,16 @@ __do_out_asm(_rec_outl, "stwbrx")
570568
#define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)(_IO_BASE+(p)),(b),(n))
571569

572570
#define __do_memset_io(addr, c, n) \
573-
_memset_io(PCI_FIX_ADDR(addr), c, n)
571+
_memset_io(addr, c, n)
574572
#define __do_memcpy_toio(dst, src, n) \
575-
_memcpy_toio(PCI_FIX_ADDR(dst), src, n)
573+
_memcpy_toio(dst, src, n)
576574

577575
#ifdef CONFIG_EEH
578576
#define __do_memcpy_fromio(dst, src, n) \
579-
eeh_memcpy_fromio(dst, PCI_FIX_ADDR(src), n)
577+
eeh_memcpy_fromio(dst, src, n)
580578
#else /* CONFIG_EEH */
581579
#define __do_memcpy_fromio(dst, src, n) \
582-
_memcpy_fromio(dst,PCI_FIX_ADDR(src),n)
580+
_memcpy_fromio(dst, src, n)
583581
#endif /* !CONFIG_EEH */
584582

585583
#ifdef CONFIG_PPC_INDIRECT_PIO

arch/powerpc/mm/ioremap_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ void iounmap(volatile void __iomem *token)
5252
if (!slab_is_available())
5353
return;
5454

55-
generic_iounmap(PCI_FIX_ADDR(token));
55+
generic_iounmap(token);
5656
}
5757
EXPORT_SYMBOL(iounmap);

0 commit comments

Comments
 (0)