Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Get rid of 'kgdb_early_setup' cruft.

Commit 854700115ecf ([MIPS] kgdb: add arch support for the kernel's kgdb core)
added the 'kgdb_early_setup' flag to avoid calling trap_init() and init_IRQ()
the second time, however the code that called these functions earlier, from
kgdb_arch_init(), had been already removed by that time, so the flag never
served any useful purpose. Remove the related code along with ugly #ifdef'ery
at last.

[ralf@linux-mips.org: Folded in Guenter Roeck's fix.]

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Patchwork: https://patchwork.linux-mips.org/patch/10501/
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Patchwork: https://patchwork.linux-mips.org/patch/10533/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Sergei Shtylyov and committed by
Ralf Baechle
52ea7bff a5fcc652

-24
-1
arch/mips/include/asm/kgdb.h
··· 33 33 #define CACHE_FLUSH_IS_SAFE 0 34 34 35 35 extern void arch_kgdb_breakpoint(void); 36 - extern int kgdb_early_setup; 37 36 extern void *saved_vectors[32]; 38 37 extern void handle_exception(struct pt_regs *regs); 39 38 extern void breakinst(void);
-14
arch/mips/kernel/irq.c
··· 25 25 #include <linux/atomic.h> 26 26 #include <asm/uaccess.h> 27 27 28 - #ifdef CONFIG_KGDB 29 - int kgdb_early_setup; 30 - #endif 31 - 32 28 static DECLARE_BITMAP(irq_map, NR_IRQS); 33 29 34 30 int allocate_irqno(void) ··· 89 93 { 90 94 int i; 91 95 92 - #ifdef CONFIG_KGDB 93 - if (kgdb_early_setup) 94 - return; 95 - #endif 96 - 97 96 for (i = 0; i < NR_IRQS; i++) 98 97 irq_set_noprobe(i); 99 98 100 99 arch_init_irq(); 101 - 102 - #ifdef CONFIG_KGDB 103 - if (!kgdb_early_setup) 104 - kgdb_early_setup = 1; 105 - #endif 106 100 } 107 101 108 102 #ifdef CONFIG_DEBUG_STACKOVERFLOW
-4
arch/mips/kernel/kgdb.c
··· 378 378 379 379 struct kgdb_arch arch_kgdb_ops; 380 380 381 - /* 382 - * We use kgdb_early_setup so that functions we need to call now don't 383 - * cause trouble when called again later. 384 - */ 385 381 int kgdb_arch_init(void) 386 382 { 387 383 union mips_instruction insn = {
-5
arch/mips/kernel/traps.c
··· 2185 2185 2186 2186 check_wait(); 2187 2187 2188 - #if defined(CONFIG_KGDB) 2189 - if (kgdb_early_setup) 2190 - return; /* Already done */ 2191 - #endif 2192 - 2193 2188 if (cpu_has_veic || cpu_has_vint) { 2194 2189 unsigned long size = 0x200 + VECTORSPACING*64; 2195 2190 ebase = (unsigned long)