From 75a23850cd282eeafbe23d6a9ade4eaf23babd51 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 18 Jul 2011 00:06:10 +1000 Subject: m68k/mac: Fix compiler warning in via_read_time() The algorithm described in the comment compares two reads from the RTC but the code actually reads once and compares the result to an uninitialized value. This causes the compiler to warn, "last_result maybe used uninitialized". Make the code match the comment, fix the warning and perhaps improve reliability. Tested on a Quadra 700. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/mac/misc.c | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'arch') diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c index e023fc6b37e5..eb915551de69 100644 --- a/arch/m68k/mac/misc.c +++ b/arch/m68k/mac/misc.c @@ -304,35 +304,41 @@ static void via_write_pram(int offset, __u8 data) static long via_read_time(void) { union { - __u8 cdata[4]; - long idata; + __u8 cdata[4]; + long idata; } result, last_result; - int ct; + int count = 1; + + via_pram_command(0x81, &last_result.cdata[3]); + via_pram_command(0x85, &last_result.cdata[2]); + via_pram_command(0x89, &last_result.cdata[1]); + via_pram_command(0x8D, &last_result.cdata[0]); /* * The NetBSD guys say to loop until you get the same reading * twice in a row. */ - ct = 0; - do { - if (++ct > 10) { - printk("via_read_time: couldn't get valid time, " - "last read = 0x%08lx and 0x%08lx\n", - last_result.idata, result.idata); - break; - } - - last_result.idata = result.idata; - result.idata = 0; - + while (1) { via_pram_command(0x81, &result.cdata[3]); via_pram_command(0x85, &result.cdata[2]); via_pram_command(0x89, &result.cdata[1]); via_pram_command(0x8D, &result.cdata[0]); - } while (result.idata != last_result.idata); - return result.idata - RTC_OFFSET; + if (result.idata == last_result.idata) + return result.idata - RTC_OFFSET; + + if (++count > 10) + break; + + last_result.idata = result.idata; + } + + pr_err("via_read_time: failed to read a stable value; " + "got 0x%08lx then 0x%08lx\n", + last_result.idata, result.idata); + + return 0; } /* -- cgit v1.2.3 From 8b223432f76acc13898b8874f55d5292da573d8e Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 18 Jul 2011 19:44:17 +1000 Subject: m68k/mac: Fix mac_irq_pending() for PSC MACE and SCC Add missing return statement. The docs say that the level 4 PSC IRQs relate to MACE DMA and SCC. Since those drivers don't call mac_irq_pending() this patch has no affect. But it should be fixed all the same, since it can be useful for MACE debugging. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/mac/macints.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index 900d899f3323..f92190c159b4 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c @@ -370,7 +370,7 @@ int mac_irq_pending(unsigned int irq) break; case 4: if (psc_present) - psc_irq_pending(irq); + return psc_irq_pending(irq); break; } return 0; -- cgit v1.2.3 From bc74ee976959616e3c1cc1341383bf2316dd4096 Mon Sep 17 00:00:00 2001 From: Kirill Tkhai Date: Sun, 4 Sep 2011 03:18:37 +0400 Subject: m68k: Finally remove leftover markers sections Markers have removed already twice: 1: fc5377668c3d808e1d53c4aee152c836f55c3490 2: eb878b3bc0349344dbf70c51bf01fc734d5cf2d3 But a little bit is still here. Signed-off-by: Tkhai Kirill Signed-off-by: Geert Uytterhoeven --- arch/m68k/kernel/vmlinux.lds_no.S | 1 - 1 file changed, 1 deletion(-) (limited to 'arch') diff --git a/arch/m68k/kernel/vmlinux.lds_no.S b/arch/m68k/kernel/vmlinux.lds_no.S index 7dc4087a9545..4e2389340837 100644 --- a/arch/m68k/kernel/vmlinux.lds_no.S +++ b/arch/m68k/kernel/vmlinux.lds_no.S @@ -77,7 +77,6 @@ SECTIONS { *(.rodata) *(.rodata.*) *(__vermagic) /* Kernel version magic */ - *(__markers_strings) *(.rodata1) *(.rodata.str1.1) -- cgit v1.2.3