diff mbox series

[v1,3/4] x86: cpu: Add a few prototypes to the header file

Message ID 20241005191353.1927660-4-andriy.shevchenko@linux.intel.com
State Accepted
Commit c1614a4ef676d55e2ec0a55b45391730ce22cdd7
Delegated to: Simon Glass
Headers show
Series x86: Clean up and fix to avoid compiler warnings | expand

Commit Message

Andy Shevchenko Oct. 5, 2024, 7:11 p.m. UTC
The compiler is not happy to have no prototypes for the functions that
are not defined static. Add them. This helps avoiding the compiler warnings:

  arch/x86/cpu/cpu.c:197:13: warning: no previous prototype for ‘board_final_init’ [-Wmissing-prototypes]
  arch/x86/cpu/cpu.c:205:13: warning: no previous prototype for ‘board_final_cleanup’ [-Wmissing-prototypes]
  arch/x86/cpu/cpu.c:307:5: warning: no previous prototype for ‘reserve_arch’ [-Wmissing-prototypes]

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 arch/x86/include/asm/cpu.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Simon Glass Oct. 9, 2024, 1:55 a.m. UTC | #1
On Sat, 5 Oct 2024 at 13:14, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> The compiler is not happy to have no prototypes for the functions that
> are not defined static. Add them. This helps avoiding the compiler warnings:
>
>   arch/x86/cpu/cpu.c:197:13: warning: no previous prototype for ‘board_final_init’ [-Wmissing-prototypes]
>   arch/x86/cpu/cpu.c:205:13: warning: no previous prototype for ‘board_final_cleanup’ [-Wmissing-prototypes]
>   arch/x86/cpu/cpu.c:307:5: warning: no previous prototype for ‘reserve_arch’ [-Wmissing-prototypes]
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  arch/x86/include/asm/cpu.h | 7 +++++++
>  1 file changed, 7 insertions(+)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

OK, but could you add proper comments for these?


> diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
> index 073f80b07f10..d71bc1b80c05 100644
> --- a/arch/x86/include/asm/cpu.h
> +++ b/arch/x86/include/asm/cpu.h
> @@ -298,4 +298,11 @@ u32 cpu_get_stepping(void);
>   */
>  int cpu_phys_address_size(void);
>
> +void board_final_init(void);
> +void board_final_cleanup(void);
> +
> +#ifndef CONFIG_EFI_STUB
> +int reserve_arch(void);
> +#endif
> +
>  #endif
> --
> 2.43.0.rc1.1336.g36b5255a03ac
>
Andy Shevchenko Oct. 9, 2024, 2:07 p.m. UTC | #2
On Tue, Oct 08, 2024 at 07:55:33PM -0600, Simon Glass wrote:
> On Sat, 5 Oct 2024 at 13:14, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > The compiler is not happy to have no prototypes for the functions that
> > are not defined static. Add them. This helps avoiding the compiler warnings:
> >
> >   arch/x86/cpu/cpu.c:197:13: warning: no previous prototype for ‘board_final_init’ [-Wmissing-prototypes]
> >   arch/x86/cpu/cpu.c:205:13: warning: no previous prototype for ‘board_final_cleanup’ [-Wmissing-prototypes]
> >   arch/x86/cpu/cpu.c:307:5: warning: no previous prototype for ‘reserve_arch’ [-Wmissing-prototypes]
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>

Thanks!

> OK, but could you add proper comments for these?

Any proposed texts for them? The comments were out of scope of my patch,
but I may add anything that is provided as a template.
Simon Glass Oct. 9, 2024, 9:14 p.m. UTC | #3
Hi Andy,

On Wed, 9 Oct 2024 at 08:08, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Tue, Oct 08, 2024 at 07:55:33PM -0600, Simon Glass wrote:
> > On Sat, 5 Oct 2024 at 13:14, Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > >
> > > The compiler is not happy to have no prototypes for the functions that
> > > are not defined static. Add them. This helps avoiding the compiler warnings:
> > >
> > >   arch/x86/cpu/cpu.c:197:13: warning: no previous prototype for ‘board_final_init’ [-Wmissing-prototypes]
> > >   arch/x86/cpu/cpu.c:205:13: warning: no previous prototype for ‘board_final_cleanup’ [-Wmissing-prototypes]
> > >   arch/x86/cpu/cpu.c:307:5: warning: no previous prototype for ‘reserve_arch’ [-Wmissing-prototypes]
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>
>
> Thanks!
>
> > OK, but could you add proper comments for these?
>
> Any proposed texts for them? The comments were out of scope of my patch,
> but I may add anything that is provided as a template.

I found some comments in one of the files, so you could use these as a
base. Whenever you change code, you should make sure it has function
comments, follows style, etc. That way things slowly get better.

/*
 * Implement a weak default function for boards that need to do some final init
 * before the system is ready.
 */
__weak void board_final_init(void)
{
}

/*
 * Implement a weak default function for boards that need to do some final
 * processing before booting the OS.
 */
__weak void board_final_cleanup(void)
{
}

Regards,
Simon
Simon Glass Oct. 17, 2024, 11:11 p.m. UTC | #4
Hi Andy,

On Wed, 9 Oct 2024 at 08:08, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Tue, Oct 08, 2024 at 07:55:33PM -0600, Simon Glass wrote:
> > On Sat, 5 Oct 2024 at 13:14, Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > >
> > > The compiler is not happy to have no prototypes for the functions that
> > > are not defined static. Add them. This helps avoiding the compiler warnings:
> > >
> > >   arch/x86/cpu/cpu.c:197:13: warning: no previous prototype for ‘board_final_init’ [-Wmissing-prototypes]
> > >   arch/x86/cpu/cpu.c:205:13: warning: no previous prototype for ‘board_final_cleanup’ [-Wmissing-prototypes]
> > >   arch/x86/cpu/cpu.c:307:5: warning: no previous prototype for ‘reserve_arch’ [-Wmissing-prototypes]
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>
>
> Thanks!
>
> > OK, but could you add proper comments for these?
>
> Any proposed texts for them? The comments were out of scope of my patch,
> but I may add anything that is provided as a template.

I found some comments in one of the files, so you could use these as a
base. Whenever you change code, you should make sure it has function
comments, follows style, etc. That way things slowly get better.

/*
 * Implement a weak default function for boards that need to do some final init
 * before the system is ready.
 */
__weak void board_final_init(void)
{
}

/*
 * Implement a weak default function for boards that need to do some final
 * processing before booting the OS.
 */
__weak void board_final_cleanup(void)
{
}

Regards,
Simon

Applied to u-boot-dm, thanks!
Andy Shevchenko Oct. 18, 2024, 11:43 a.m. UTC | #5
On Thu, Oct 17, 2024 at 04:11:48PM -0700, Simon Glass wrote:
> On Wed, 9 Oct 2024 at 08:08, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Tue, Oct 08, 2024 at 07:55:33PM -0600, Simon Glass wrote:
> > > On Sat, 5 Oct 2024 at 13:14, Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:
> > > >
> > > > The compiler is not happy to have no prototypes for the functions that
> > > > are not defined static. Add them. This helps avoiding the compiler warnings:
> > > >
> > > >   arch/x86/cpu/cpu.c:197:13: warning: no previous prototype for ‘board_final_init’ [-Wmissing-prototypes]
> > > >   arch/x86/cpu/cpu.c:205:13: warning: no previous prototype for ‘board_final_cleanup’ [-Wmissing-prototypes]
> > > >   arch/x86/cpu/cpu.c:307:5: warning: no previous prototype for ‘reserve_arch’ [-Wmissing-prototypes]
> > >
> > > Reviewed-by: Simon Glass <sjg@chromium.org>
> >
> > Thanks!
> >
> > > OK, but could you add proper comments for these?
> >
> > Any proposed texts for them? The comments were out of scope of my patch,
> > but I may add anything that is provided as a template.
> 
> I found some comments in one of the files, so you could use these as a
> base. Whenever you change code, you should make sure it has function
> comments, follows style, etc. That way things slowly get better.
> 
> /*
>  * Implement a weak default function for boards that need to do some final init
>  * before the system is ready.
>  */
> __weak void board_final_init(void)
> {
> }
> 
> /*
>  * Implement a weak default function for boards that need to do some final
>  * processing before booting the OS.
>  */
> __weak void board_final_cleanup(void)
> {
> }
> 
> Applied to u-boot-dm, thanks!

Thanks, but what does it mean to me? Should I send an update to add the comments?
Simon Glass Oct. 18, 2024, 2:55 p.m. UTC | #6
Hi Andy,

On Fri, 18 Oct 2024 at 05:43, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Thu, Oct 17, 2024 at 04:11:48PM -0700, Simon Glass wrote:
> > On Wed, 9 Oct 2024 at 08:08, Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > > On Tue, Oct 08, 2024 at 07:55:33PM -0600, Simon Glass wrote:
> > > > On Sat, 5 Oct 2024 at 13:14, Andy Shevchenko
> > > > <andriy.shevchenko@linux.intel.com> wrote:
> > > > >
> > > > > The compiler is not happy to have no prototypes for the functions that
> > > > > are not defined static. Add them. This helps avoiding the compiler warnings:
> > > > >
> > > > >   arch/x86/cpu/cpu.c:197:13: warning: no previous prototype for ‘board_final_init’ [-Wmissing-prototypes]
> > > > >   arch/x86/cpu/cpu.c:205:13: warning: no previous prototype for ‘board_final_cleanup’ [-Wmissing-prototypes]
> > > > >   arch/x86/cpu/cpu.c:307:5: warning: no previous prototype for ‘reserve_arch’ [-Wmissing-prototypes]
> > > >
> > > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > >
> > > Thanks!
> > >
> > > > OK, but could you add proper comments for these?
> > >
> > > Any proposed texts for them? The comments were out of scope of my patch,
> > > but I may add anything that is provided as a template.
> >
> > I found some comments in one of the files, so you could use these as a
> > base. Whenever you change code, you should make sure it has function
> > comments, follows style, etc. That way things slowly get better.
> >
> > /*
> >  * Implement a weak default function for boards that need to do some final init
> >  * before the system is ready.
> >  */
> > __weak void board_final_init(void)
> > {
> > }
> >
> > /*
> >  * Implement a weak default function for boards that need to do some final
> >  * processing before booting the OS.
> >  */
> > __weak void board_final_cleanup(void)
> > {
> > }
> >
> > Applied to u-boot-dm, thanks!
>
> Thanks, but what does it mean to me? Should I send an update to add the comments?

Yes, please. I'm just tidying up some x86 patches while Bin is away.

Regards,
Simon
Andy Shevchenko Oct. 18, 2024, 3:56 p.m. UTC | #7
On Fri, Oct 18, 2024 at 08:55:00AM -0600, Simon Glass wrote:
> On Fri, 18 Oct 2024 at 05:43, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Thu, Oct 17, 2024 at 04:11:48PM -0700, Simon Glass wrote:
> > > On Wed, 9 Oct 2024 at 08:08, Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:

...

> > > /*
> > >  * Implement a weak default function for boards that need to do some final init
> > >  * before the system is ready.
> > >  */
> > > __weak void board_final_init(void)
> > > {
> > > }
> > >
> > > /*
> > >  * Implement a weak default function for boards that need to do some final
> > >  * processing before booting the OS.
> > >  */
> > > __weak void board_final_cleanup(void)
> > > {
> > > }
> > >
> > > Applied to u-boot-dm, thanks!
> >
> > Thanks, but what does it mean to me? Should I send an update to add the comments?
> 
> Yes, please. I'm just tidying up some x86 patches while Bin is away.

Patch has just been sent.
diff mbox series

Patch

diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
index 073f80b07f10..d71bc1b80c05 100644
--- a/arch/x86/include/asm/cpu.h
+++ b/arch/x86/include/asm/cpu.h
@@ -298,4 +298,11 @@  u32 cpu_get_stepping(void);
  */
 int cpu_phys_address_size(void);
 
+void board_final_init(void);
+void board_final_cleanup(void);
+
+#ifndef CONFIG_EFI_STUB
+int reserve_arch(void);
+#endif
+
 #endif