Commit 31b1c780 authored by Finn Thain's avatar Finn Thain Committed by Geert Uytterhoeven

m68k/mac: Clean up whitespace and remove redundant parentheses

Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
parent 51fd6276
...@@ -43,14 +43,15 @@ static long cuda_read_time(void) ...@@ -43,14 +43,15 @@ static long cuda_read_time(void)
while (!req.complete) while (!req.complete)
cuda_poll(); cuda_poll();
time = (req.reply[3] << 24) | (req.reply[4] << 16) time = (req.reply[3] << 24) | (req.reply[4] << 16) |
| (req.reply[5] << 8) | req.reply[6]; (req.reply[5] << 8) | req.reply[6];
return time - RTC_OFFSET; return time - RTC_OFFSET;
} }
static void cuda_write_time(long data) static void cuda_write_time(long data)
{ {
struct adb_request req; struct adb_request req;
data += RTC_OFFSET; data += RTC_OFFSET;
if (cuda_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME, if (cuda_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME,
(data >> 24) & 0xFF, (data >> 16) & 0xFF, (data >> 24) & 0xFF, (data >> 16) & 0xFF,
...@@ -63,6 +64,7 @@ static void cuda_write_time(long data) ...@@ -63,6 +64,7 @@ static void cuda_write_time(long data)
static __u8 cuda_read_pram(int offset) static __u8 cuda_read_pram(int offset)
{ {
struct adb_request req; struct adb_request req;
if (cuda_request(&req, NULL, 4, CUDA_PACKET, CUDA_GET_PRAM, if (cuda_request(&req, NULL, 4, CUDA_PACKET, CUDA_GET_PRAM,
(offset >> 8) & 0xFF, offset & 0xFF) < 0) (offset >> 8) & 0xFF, offset & 0xFF) < 0)
return 0; return 0;
...@@ -74,6 +76,7 @@ static __u8 cuda_read_pram(int offset) ...@@ -74,6 +76,7 @@ static __u8 cuda_read_pram(int offset)
static void cuda_write_pram(int offset, __u8 data) static void cuda_write_pram(int offset, __u8 data)
{ {
struct adb_request req; struct adb_request req;
if (cuda_request(&req, NULL, 5, CUDA_PACKET, CUDA_SET_PRAM, if (cuda_request(&req, NULL, 5, CUDA_PACKET, CUDA_SET_PRAM,
(offset >> 8) & 0xFF, offset & 0xFF, data) < 0) (offset >> 8) & 0xFF, offset & 0xFF, data) < 0)
return; return;
...@@ -98,14 +101,15 @@ static long pmu_read_time(void) ...@@ -98,14 +101,15 @@ static long pmu_read_time(void)
while (!req.complete) while (!req.complete)
pmu_poll(); pmu_poll();
time = (req.reply[1] << 24) | (req.reply[2] << 16) time = (req.reply[1] << 24) | (req.reply[2] << 16) |
| (req.reply[3] << 8) | req.reply[4]; (req.reply[3] << 8) | req.reply[4];
return time - RTC_OFFSET; return time - RTC_OFFSET;
} }
static void pmu_write_time(long data) static void pmu_write_time(long data)
{ {
struct adb_request req; struct adb_request req;
data += RTC_OFFSET; data += RTC_OFFSET;
if (pmu_request(&req, NULL, 5, PMU_SET_RTC, if (pmu_request(&req, NULL, 5, PMU_SET_RTC,
(data >> 24) & 0xFF, (data >> 16) & 0xFF, (data >> 24) & 0xFF, (data >> 16) & 0xFF,
...@@ -118,6 +122,7 @@ static void pmu_write_time(long data) ...@@ -118,6 +122,7 @@ static void pmu_write_time(long data)
static __u8 pmu_read_pram(int offset) static __u8 pmu_read_pram(int offset)
{ {
struct adb_request req; struct adb_request req;
if (pmu_request(&req, NULL, 3, PMU_READ_NVRAM, if (pmu_request(&req, NULL, 3, PMU_READ_NVRAM,
(offset >> 8) & 0xFF, offset & 0xFF) < 0) (offset >> 8) & 0xFF, offset & 0xFF) < 0)
return 0; return 0;
...@@ -129,6 +134,7 @@ static __u8 pmu_read_pram(int offset) ...@@ -129,6 +134,7 @@ static __u8 pmu_read_pram(int offset)
static void pmu_write_pram(int offset, __u8 data) static void pmu_write_pram(int offset, __u8 data)
{ {
struct adb_request req; struct adb_request req;
if (pmu_request(&req, NULL, 4, PMU_WRITE_NVRAM, if (pmu_request(&req, NULL, 4, PMU_WRITE_NVRAM,
(offset >> 8) & 0xFF, offset & 0xFF, data) < 0) (offset >> 8) & 0xFF, offset & 0xFF, data) < 0)
return; return;
...@@ -151,7 +157,7 @@ static void pmu_write_pram(int offset, __u8 data) ...@@ -151,7 +157,7 @@ static void pmu_write_pram(int offset, __u8 data)
static __u8 via_pram_readbyte(void) static __u8 via_pram_readbyte(void)
{ {
int i,reg; int i, reg;
__u8 data; __u8 data;
reg = via1[vBufB] & ~VIA1B_vRTCClk; reg = via1[vBufB] & ~VIA1B_vRTCClk;
...@@ -178,7 +184,7 @@ static __u8 via_pram_readbyte(void) ...@@ -178,7 +184,7 @@ static __u8 via_pram_readbyte(void)
static void via_pram_writebyte(__u8 data) static void via_pram_writebyte(__u8 data)
{ {
int i,reg,bit; int i, reg, bit;
reg = via1[vBufB] & ~(VIA1B_vRTCClk | VIA1B_vRTCData); reg = via1[vBufB] & ~(VIA1B_vRTCClk | VIA1B_vRTCData);
...@@ -343,10 +349,10 @@ static void oss_shutdown(void) ...@@ -343,10 +349,10 @@ static void oss_shutdown(void)
} }
#ifdef CONFIG_ADB_CUDA #ifdef CONFIG_ADB_CUDA
static void cuda_restart(void) static void cuda_restart(void)
{ {
struct adb_request req; struct adb_request req;
if (cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_RESET_SYSTEM) < 0) if (cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_RESET_SYSTEM) < 0)
return; return;
while (!req.complete) while (!req.complete)
...@@ -356,6 +362,7 @@ static void cuda_restart(void) ...@@ -356,6 +362,7 @@ static void cuda_restart(void)
static void cuda_shutdown(void) static void cuda_shutdown(void)
{ {
struct adb_request req; struct adb_request req;
if (cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_POWERDOWN) < 0) if (cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_POWERDOWN) < 0)
return; return;
...@@ -372,7 +379,6 @@ static void cuda_shutdown(void) ...@@ -372,7 +379,6 @@ static void cuda_shutdown(void)
while (!req.complete) while (!req.complete)
cuda_poll(); cuda_poll();
} }
#endif /* CONFIG_ADB_CUDA */ #endif /* CONFIG_ADB_CUDA */
#ifdef CONFIG_ADB_PMU68K #ifdef CONFIG_ADB_PMU68K
...@@ -419,13 +425,15 @@ void mac_pram_read(int offset, __u8 *buffer, int len) ...@@ -419,13 +425,15 @@ void mac_pram_read(int offset, __u8 *buffer, int len)
__u8 (*func)(int); __u8 (*func)(int);
int i; int i;
switch(macintosh_config->adb_type) { switch (macintosh_config->adb_type) {
case MAC_ADB_PB1: case MAC_ADB_PB1:
case MAC_ADB_PB2: case MAC_ADB_PB2:
func = pmu_read_pram; break; func = pmu_read_pram;
break;
case MAC_ADB_EGRET: case MAC_ADB_EGRET:
case MAC_ADB_CUDA: case MAC_ADB_CUDA:
func = cuda_read_pram; break; func = cuda_read_pram;
break;
default: default:
func = via_read_pram; func = via_read_pram;
} }
...@@ -441,13 +449,15 @@ void mac_pram_write(int offset, __u8 *buffer, int len) ...@@ -441,13 +449,15 @@ void mac_pram_write(int offset, __u8 *buffer, int len)
void (*func)(int, __u8); void (*func)(int, __u8);
int i; int i;
switch(macintosh_config->adb_type) { switch (macintosh_config->adb_type) {
case MAC_ADB_PB1: case MAC_ADB_PB1:
case MAC_ADB_PB2: case MAC_ADB_PB2:
func = pmu_write_pram; break; func = pmu_write_pram;
break;
case MAC_ADB_EGRET: case MAC_ADB_EGRET:
case MAC_ADB_CUDA: case MAC_ADB_CUDA:
func = cuda_write_pram; break; func = cuda_write_pram;
break;
default: default:
func = via_write_pram; func = via_write_pram;
} }
...@@ -531,6 +541,7 @@ void mac_reset(void) ...@@ -531,6 +541,7 @@ void mac_reset(void)
unsigned long phys = virt_to_phys(mac_reset); unsigned long phys = virt_to_phys(mac_reset);
unsigned long addr = (phys&0xFF000000)|0x8777; unsigned long addr = (phys&0xFF000000)|0x8777;
unsigned long offset = phys-virt; unsigned long offset = phys-virt;
local_irq_disable(); /* lets not screw this up, ok? */ local_irq_disable(); /* lets not screw this up, ok? */
__asm__ __volatile__(".chip 68030\n\t" __asm__ __volatile__(".chip 68030\n\t"
"pmove %0,%/tt0\n\t" "pmove %0,%/tt0\n\t"
...@@ -627,9 +638,8 @@ static void unmktime(unsigned long time, long offset, ...@@ -627,9 +638,8 @@ static void unmktime(unsigned long time, long offset,
long int yg = y + days / 365 - (days % 365 < 0); long int yg = y + days / 365 - (days % 365 < 0);
/* Adjust DAYS and Y to match the guessed year. */ /* Adjust DAYS and Y to match the guessed year. */
days -= ((yg - y) * 365 days -= (yg - y) * 365 +
+ LEAPS_THRU_END_OF (yg - 1) LEAPS_THRU_END_OF(yg - 1) - LEAPS_THRU_END_OF(y - 1);
- LEAPS_THRU_END_OF (y - 1));
y = yg; y = yg;
} }
*yearp = y - 1900; *yearp = y - 1900;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment