Skip to content

Commit c36dd29

Browse files
committed
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 <[email protected]> Reviewed-by: Finn Thain <[email protected]> Link: https://lore.kernel.org/r/fa48394ecba7c29a2da354d13c1017b37237f25b.1657114783.git.geert@linux-m68k.org
1 parent 566a2d6 commit c36dd29

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

arch/m68k/mac/macints.c

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@
129129

130130
extern void show_registers(struct pt_regs *);
131131

132-
irqreturn_t mac_nmi_handler(int, void *);
133-
134132
static unsigned int mac_irq_startup(struct irq_data *);
135133
static void mac_irq_shutdown(struct irq_data *);
136134

@@ -142,6 +140,21 @@ static struct irq_chip mac_irq_chip = {
142140
.irq_shutdown = mac_irq_shutdown,
143141
};
144142

143+
static irqreturn_t mac_nmi_handler(int irq, void *dev_id)
144+
{
145+
static volatile int in_nmi;
146+
147+
if (in_nmi)
148+
return IRQ_HANDLED;
149+
in_nmi = 1;
150+
151+
pr_info("Non-Maskable Interrupt\n");
152+
show_registers(get_irq_regs());
153+
154+
in_nmi = 0;
155+
return IRQ_HANDLED;
156+
}
157+
145158
void __init mac_init_IRQ(void)
146159
{
147160
m68k_setup_irq_controller(&mac_irq_chip, handle_simple_irq, IRQ_USER,
@@ -254,18 +267,3 @@ static void mac_irq_shutdown(struct irq_data *data)
254267
else
255268
mac_irq_disable(data);
256269
}
257-
258-
static volatile int in_nmi;
259-
260-
irqreturn_t mac_nmi_handler(int irq, void *dev_id)
261-
{
262-
if (in_nmi)
263-
return IRQ_HANDLED;
264-
in_nmi = 1;
265-
266-
pr_info("Non-Maskable Interrupt\n");
267-
show_registers(get_irq_regs());
268-
269-
in_nmi = 0;
270-
return IRQ_HANDLED;
271-
}

0 commit comments

Comments
 (0)