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

m68k: mac: Remove forward declaration for mac_nmi_handler()

Move mac_nmi_handler() before its caller, so its forward declaration can
be dropped. While at it, make the function static, and absorb the
variable in_nmi, which is only used inside the function.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Finn Thain <fthain@linux-m68k.org>
Link: https://lore.kernel.org/r/fa48394ecba7c29a2da354d13c1017b37237f25b.1657114783.git.geert@linux-m68k.org

+15 -17
+15 -17
arch/m68k/mac/macints.c
··· 129 129 130 130 extern void show_registers(struct pt_regs *); 131 131 132 - irqreturn_t mac_nmi_handler(int, void *); 133 - 134 132 static unsigned int mac_irq_startup(struct irq_data *); 135 133 static void mac_irq_shutdown(struct irq_data *); 136 134 ··· 139 141 .irq_startup = mac_irq_startup, 140 142 .irq_shutdown = mac_irq_shutdown, 141 143 }; 144 + 145 + static irqreturn_t mac_nmi_handler(int irq, void *dev_id) 146 + { 147 + static volatile int in_nmi; 148 + 149 + if (in_nmi) 150 + return IRQ_HANDLED; 151 + in_nmi = 1; 152 + 153 + pr_info("Non-Maskable Interrupt\n"); 154 + show_registers(get_irq_regs()); 155 + 156 + in_nmi = 0; 157 + return IRQ_HANDLED; 158 + } 142 159 143 160 void __init mac_init_IRQ(void) 144 161 { ··· 266 253 via_nubus_irq_shutdown(irq); 267 254 else 268 255 mac_irq_disable(data); 269 - } 270 - 271 - static volatile int in_nmi; 272 - 273 - irqreturn_t mac_nmi_handler(int irq, void *dev_id) 274 - { 275 - if (in_nmi) 276 - return IRQ_HANDLED; 277 - in_nmi = 1; 278 - 279 - pr_info("Non-Maskable Interrupt\n"); 280 - show_registers(get_irq_regs()); 281 - 282 - in_nmi = 0; 283 - return IRQ_HANDLED; 284 256 }