From 957ecd7dc835d40d110e8c8f460d1956420f86b1 Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Thu, 13 Mar 2008 23:52:13 +0100 Subject: avr32: Build fix for CONFIG_BUG=n Don't include the BUG trap handling code when CONFIG_BUG is not set. This fixes allnoconfig. Signed-off-by: Haavard Skinnemoen --- arch/avr32/kernel/traps.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch') diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c index cf6f686d9b0..b835c4c0136 100644 --- a/arch/avr32/kernel/traps.c +++ b/arch/avr32/kernel/traps.c @@ -178,6 +178,7 @@ static int do_cop_absent(u32 insn) return 0; } +#ifdef CONFIG_BUG int is_valid_bugaddr(unsigned long pc) { unsigned short opcode; @@ -189,6 +190,7 @@ int is_valid_bugaddr(unsigned long pc) return opcode == AVR32_BUG_OPCODE; } +#endif asmlinkage void do_illegal_opcode(unsigned long ecr, struct pt_regs *regs) { @@ -197,6 +199,7 @@ asmlinkage void do_illegal_opcode(unsigned long ecr, struct pt_regs *regs) void __user *pc; long code; +#ifdef CONFIG_BUG if (!user_mode(regs) && (ecr == ECR_ILLEGAL_OPCODE)) { enum bug_trap_type type; @@ -211,6 +214,7 @@ asmlinkage void do_illegal_opcode(unsigned long ecr, struct pt_regs *regs) die("Kernel BUG", regs, SIGKILL); } } +#endif local_irq_enable(); -- cgit v1.2.3-70-g09d2 From a2a395256134a24d906d5e67e03e853c580b37ed Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Thu, 27 Mar 2008 15:24:12 +0100 Subject: avr32: Fix bug in early resource allocation code add_reserved_region() tries to keep the resource list sorted, so when looking for a place to insert the new resource, it may break out before the last entry. When this happens, the list is broken in two because the sibling field of the new entry doesn't point to the next resource. Fix it by updating the new resource's sibling field appropriately. Signed-off-by: Haavard Skinnemoen --- arch/avr32/kernel/setup.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch') diff --git a/arch/avr32/kernel/setup.c b/arch/avr32/kernel/setup.c index e66a07a928c..2687b730e2d 100644 --- a/arch/avr32/kernel/setup.c +++ b/arch/avr32/kernel/setup.c @@ -163,6 +163,7 @@ add_reserved_region(resource_size_t start, resource_size_t end, new->start = start; new->end = end; new->name = name; + new->sibling = next; new->flags = IORESOURCE_MEM; *pprev = new; -- cgit v1.2.3-70-g09d2