linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/4xx: Remove WatchdogHandler() to fix no previous prototype error
@ 2023-08-17 12:40 Christophe Leroy
  2023-08-17 12:42 ` Arnd Bergmann
  2023-08-23 11:55 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe Leroy @ 2023-08-17 12:40 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin
  Cc: Arnd Bergmann, linuxppc-dev, linux-kernel

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>
Cc: Arnd Bergmann <arnd@arndb.de>
---
 arch/powerpc/kernel/traps.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index f5ce282dc4b8..eeff136b83d9 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -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
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/4xx: Remove WatchdogHandler() to fix no previous prototype error
  2023-08-17 12:40 [PATCH] powerpc/4xx: Remove WatchdogHandler() to fix no previous prototype error Christophe Leroy
@ 2023-08-17 12:42 ` Arnd Bergmann
  2023-08-23 11:55 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2023-08-17 12:42 UTC (permalink / raw)
  To: Christophe Leroy, Michael Ellerman, Nicholas Piggin
  Cc: linuxppc-dev, linux-kernel

On Thu, Aug 17, 2023, at 14:40, Christophe Leroy wrote:
> 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>
> Cc: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/4xx: Remove WatchdogHandler() to fix no previous prototype error
  2023-08-17 12:40 [PATCH] powerpc/4xx: Remove WatchdogHandler() to fix no previous prototype error Christophe Leroy
  2023-08-17 12:42 ` Arnd Bergmann
@ 2023-08-23 11:55 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2023-08-23 11:55 UTC (permalink / raw)
  To: Nicholas Piggin, Christophe Leroy
  Cc: linuxppc-dev, linux-kernel, Arnd Bergmann

On Thu, 17 Aug 2023 14:40:49 +0200, Christophe Leroy wrote:
> 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)
>       |                             ^~~~~~~~~~~~~~~
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/4xx: Remove WatchdogHandler() to fix no previous prototype error
      https://git.kernel.org/powerpc/c/ca13c130a43fe3ab625d22ada0a61e5c0b612229

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-23 12:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-17 12:40 [PATCH] powerpc/4xx: Remove WatchdogHandler() to fix no previous prototype error Christophe Leroy
2023-08-17 12:42 ` Arnd Bergmann
2023-08-23 11:55 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).