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

A W=1 build of mpc885_ads_defconfig throws the following error:

  CC      arch/powerpc/platforms/8xx/m8xx_setup.o
arch/powerpc/platforms/8xx/m8xx_setup.c:41:1: error: no previous prototype for 'init_internal_rtc' [-Werror=missing-prototypes]
   41 | init_internal_rtc(void)
      | ^~~~~~~~~~~~~~~~~

init_internal_rtc() was introduced by commit df34403dcaac ("[POWERPC]
8xx: Add mpc885ads support and common mpc8xx files") as a weak
function but has never been defined and/or used outside m8xx_setup.c

As it is called only once there, just fold it into its caller and
remove it.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Arnd Bergmann <arnd@arndb.de>
---
 arch/powerpc/platforms/8xx/m8xx_setup.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c
index 3c5c4e08b6a9..2336b687bc96 100644
--- a/arch/powerpc/platforms/8xx/m8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
@@ -36,17 +36,6 @@ static irqreturn_t timebase_interrupt(int irq, void *dev)
 	return IRQ_HANDLED;
 }
 
-/* per-board overridable init_internal_rtc() function. */
-void __init __attribute__ ((weak))
-init_internal_rtc(void)
-{
-	/* Disable the RTC one second and alarm interrupts. */
-	clrbits16(&mpc8xx_immr->im_sit.sit_rtcsc, (RTCSC_SIE | RTCSC_ALE));
-
-	/* Enable the RTC */
-	setbits16(&mpc8xx_immr->im_sit.sit_rtcsc, (RTCSC_RTF | RTCSC_RTE));
-}
-
 static int __init get_freq(char *name, unsigned long *val)
 {
 	struct device_node *cpu;
@@ -117,7 +106,11 @@ void __init mpc8xx_calibrate_decr(void)
 	out_be32(&mpc8xx_immr->im_sitk.sitk_rtcsck, KAPWR_KEY);
 	out_be32(&mpc8xx_immr->im_sitk.sitk_tbk, KAPWR_KEY);
 
-	init_internal_rtc();
+	/* Disable the RTC one second and alarm interrupts. */
+	clrbits16(&mpc8xx_immr->im_sit.sit_rtcsc, (RTCSC_SIE | RTCSC_ALE));
+
+	/* Enable the RTC */
+	setbits16(&mpc8xx_immr->im_sit.sit_rtcsc, (RTCSC_RTF | RTCSC_RTE));
 
 	/* Enabling the decrementer also enables the timebase interrupts
 	 * (or from the other point of view, to get decrementer interrupts
-- 
2.41.0


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

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

On Thu, Aug 17, 2023, at 14:26, Christophe Leroy wrote:
> A W=1 build of mpc885_ads_defconfig throws the following error:
>
>   CC      arch/powerpc/platforms/8xx/m8xx_setup.o
> arch/powerpc/platforms/8xx/m8xx_setup.c:41:1: error: no previous 
> prototype for 'init_internal_rtc' [-Werror=missing-prototypes]
>    41 | init_internal_rtc(void)
>       | ^~~~~~~~~~~~~~~~~
>
> init_internal_rtc() was introduced by commit df34403dcaac ("[POWERPC]
> 8xx: Add mpc885ads support and common mpc8xx files") as a weak
> function but has never been defined and/or used outside m8xx_setup.c
>
> As it is called only once there, just fold it into 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/8xx: Remove init_internal_rtc() to fix no previous prototype error
  2023-08-17 12:26 [PATCH] powerpc/8xx: Remove init_internal_rtc() to fix no previous prototype error Christophe Leroy
  2023-08-17 12:43 ` 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:26:45 +0200, Christophe Leroy wrote:
> A W=1 build of mpc885_ads_defconfig throws the following error:
> 
>   CC      arch/powerpc/platforms/8xx/m8xx_setup.o
> arch/powerpc/platforms/8xx/m8xx_setup.c:41:1: error: no previous prototype for 'init_internal_rtc' [-Werror=missing-prototypes]
>    41 | init_internal_rtc(void)
>       | ^~~~~~~~~~~~~~~~~
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/8xx: Remove init_internal_rtc() to fix no previous prototype error
      https://git.kernel.org/powerpc/c/4531f128eac356144545b833908b6ffbc0292e16

cheers

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

end of thread, other threads:[~2023-08-23 12:09 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:26 [PATCH] powerpc/8xx: Remove init_internal_rtc() to fix no previous prototype error Christophe Leroy
2023-08-17 12:43 ` 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).