aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sh/boards/bigsur/io.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/sh/boards/bigsur/io.c b/arch/sh/boards/bigsur/io.c
index 697144de7419..a9fde781b21a 100644
--- a/arch/sh/boards/bigsur/io.c
+++ b/arch/sh/boards/bigsur/io.c
@@ -37,10 +37,6 @@ static u8 bigsur_iomap_lo_shift[BIGSUR_IOMAP_LO_NMAP];
37static u32 bigsur_iomap_hi[BIGSUR_IOMAP_HI_NMAP]; 37static u32 bigsur_iomap_hi[BIGSUR_IOMAP_HI_NMAP];
38static u8 bigsur_iomap_hi_shift[BIGSUR_IOMAP_HI_NMAP]; 38static u8 bigsur_iomap_hi_shift[BIGSUR_IOMAP_HI_NMAP];
39 39
40#ifndef MAX
41#define MAX(a,b) ((a)>(b)?(a):(b))
42#endif
43
44void bigsur_port_map(u32 baseport, u32 nports, u32 addr, u8 shift) 40void bigsur_port_map(u32 baseport, u32 nports, u32 addr, u8 shift)
45{ 41{
46 u32 port, endport = baseport + nports; 42 u32 port, endport = baseport + nports;
@@ -57,7 +53,7 @@ void bigsur_port_map(u32 baseport, u32 nports, u32 addr, u8 shift)
57 addr += (1<<(BIGSUR_IOMAP_LO_SHIFT)); 53 addr += (1<<(BIGSUR_IOMAP_LO_SHIFT));
58 } 54 }
59 55
60 for (port = MAX(baseport, BIGSUR_IOMAP_LO_THRESH) ; 56 for (port = max_t(u32, baseport, BIGSUR_IOMAP_LO_THRESH);
61 port < endport && port < BIGSUR_IOMAP_HI_THRESH ; 57 port < endport && port < BIGSUR_IOMAP_HI_THRESH ;
62 port += (1<<BIGSUR_IOMAP_HI_SHIFT)) { 58 port += (1<<BIGSUR_IOMAP_HI_SHIFT)) {
63 pr_debug(" maphi[0x%x] = 0x%08x\n", port, addr); 59 pr_debug(" maphi[0x%x] = 0x%08x\n", port, addr);
@@ -80,7 +76,7 @@ void bigsur_port_unmap(u32 baseport, u32 nports)
80 bigsur_iomap_lo[port>>BIGSUR_IOMAP_LO_SHIFT] = 0; 76 bigsur_iomap_lo[port>>BIGSUR_IOMAP_LO_SHIFT] = 0;
81 } 77 }
82 78
83 for (port = MAX(baseport, BIGSUR_IOMAP_LO_THRESH) ; 79 for (port = max_t(u32, baseport, BIGSUR_IOMAP_LO_THRESH);
84 port < endport && port < BIGSUR_IOMAP_HI_THRESH ; 80 port < endport && port < BIGSUR_IOMAP_HI_THRESH ;
85 port += (1<<BIGSUR_IOMAP_HI_SHIFT)) { 81 port += (1<<BIGSUR_IOMAP_HI_SHIFT)) {
86 bigsur_iomap_hi[port>>BIGSUR_IOMAP_HI_SHIFT] = 0; 82 bigsur_iomap_hi[port>>BIGSUR_IOMAP_HI_SHIFT] = 0;