powerpc/4xx: Remove WatchdogHandler() to fix no previous prototype error
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Thu, 17 Aug 2023 12:40:49 +0000 (14:40 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 18 Aug 2023 07:03:14 +0000 (17:03 +1000)
Building ppc40x_defconfig throws the following error:

  CC      arch/powerpc/kernel/traps.o
arch/powerpc/kernel/traps.c:2232:29: warning: no previous prototype for 'WatchdogHandler' [-Wmissing-prototypes]
 2232 | void __attribute__ ((weak)) WatchdogHandler(struct pt_regs *regs)
      |                             ^~~~~~~~~~~~~~~

This function was imported by commit 14cf11af6cf6 ("powerpc: Merge
enough to start building in arch/powerpc.") as a weak function but
never defined and/or called outside traps.c

As it has only one caller fold it inside its caller and remove it.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/38fe1078eb403eef74dc8f29387636fd7ecdf43c.1692276041.git.christophe.leroy@csgroup.eu
arch/powerpc/kernel/traps.c

index f5ce282dc4b8b43a734d0cac2d45de9f869f36d1..eeff136b83d97b22343cf1b7ce8b3b0144f5943c 100644 (file)
@@ -2225,21 +2225,10 @@ void __noreturn unrecoverable_exception(struct pt_regs *regs)
 }
 
 #if defined(CONFIG_BOOKE_WDT) || defined(CONFIG_40x)
-/*
- * Default handler for a Watchdog exception,
- * spins until a reboot occurs
- */
-void __attribute__ ((weak)) WatchdogHandler(struct pt_regs *regs)
-{
-       /* Generic WatchdogHandler, implement your own */
-       mtspr(SPRN_TCR, mfspr(SPRN_TCR)&(~TCR_WIE));
-       return;
-}
-
 DEFINE_INTERRUPT_HANDLER_NMI(WatchdogException)
 {
        printk (KERN_EMERG "PowerPC Book-E Watchdog Exception\n");
-       WatchdogHandler(regs);
+       mtspr(SPRN_TCR, mfspr(SPRN_TCR) & ~TCR_WIE);
        return 0;
 }
 #endif