2021-05-21 20:07:15

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH] MIPS: launch.h: add include guard to prevent build errors

arch/mips/include/asm/mips-boards/launch.h needs an include guard
to prevent it from being #included more than once.
Prevents these build errors:

In file included from ../arch/mips/mti-malta/malta-amon.c:16:
../arch/mips/include/asm/mips-boards/launch.h:8:8: error: redefinition of 'struct cpulaunch'
8 | struct cpulaunch {
| ^~~~~~~~~
In file included from ../arch/mips/include/asm/mips-cps.h:13,
from ../arch/mips/include/asm/smp-ops.h:16,
from ../arch/mips/include/asm/smp.h:21,
from ../include/linux/smp.h:114,
from ../arch/mips/mti-malta/malta-amon.c:12:
../arch/mips/include/asm/mips-boards/launch.h:8:8: note: originally defined here
8 | struct cpulaunch {
| ^~~~~~~~~
make[3]: [../scripts/Makefile.build:273: arch/mips/mti-malta/malta-amon.o] Error 1 (ignored)

Fixes: 6decd1aad15f ("MIPS: add support for buggy MT7621S core detection")
Signed-off-by: Randy Dunlap <[email protected]>
Reported-by: kernel test robot <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: [email protected]
Cc: Ilya Lipnitskiy <[email protected]>
---
arch/mips/include/asm/mips-boards/launch.h | 5 +++++
1 file changed, 5 insertions(+)

--- linux-next-20210520.orig/arch/mips/include/asm/mips-boards/launch.h
+++ linux-next-20210520/arch/mips/include/asm/mips-boards/launch.h
@@ -3,6 +3,9 @@
*
*/

+#ifndef _ASM_MIPS_BOARDS_LAUNCH_H
+#define _ASM_MIPS_BOARDS_LAUNCH_H
+
#ifndef _ASSEMBLER_

struct cpulaunch {
@@ -34,3 +37,5 @@ struct cpulaunch {

/* Polling period in count cycles for secondary CPU's */
#define LAUNCHPERIOD 10000
+
+#endif /* _ASM_MIPS_BOARDS_LAUNCH_H */


2021-05-22 18:27:42

by Ilya Lipnitskiy

[permalink] [raw]
Subject: Re: [PATCH] MIPS: launch.h: add include guard to prevent build errors

On Thu, May 20, 2021 at 10:13 PM Randy Dunlap <[email protected]> wrote:
>
> arch/mips/include/asm/mips-boards/launch.h needs an include guard
> to prevent it from being #included more than once.
> Prevents these build errors:
>
> In file included from ../arch/mips/mti-malta/malta-amon.c:16:
> ../arch/mips/include/asm/mips-boards/launch.h:8:8: error: redefinition of 'struct cpulaunch'
> 8 | struct cpulaunch {
> | ^~~~~~~~~
> In file included from ../arch/mips/include/asm/mips-cps.h:13,
> from ../arch/mips/include/asm/smp-ops.h:16,
> from ../arch/mips/include/asm/smp.h:21,
> from ../include/linux/smp.h:114,
> from ../arch/mips/mti-malta/malta-amon.c:12:
> ../arch/mips/include/asm/mips-boards/launch.h:8:8: note: originally defined here
> 8 | struct cpulaunch {
> | ^~~~~~~~~
> make[3]: [../scripts/Makefile.build:273: arch/mips/mti-malta/malta-amon.o] Error 1 (ignored)
>
> Fixes: 6decd1aad15f ("MIPS: add support for buggy MT7621S core detection")
> Signed-off-by: Randy Dunlap <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Cc: Thomas Bogendoerfer <[email protected]>
> Cc: [email protected]
> Cc: Ilya Lipnitskiy <[email protected]>
> ---
> arch/mips/include/asm/mips-boards/launch.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> --- linux-next-20210520.orig/arch/mips/include/asm/mips-boards/launch.h
> +++ linux-next-20210520/arch/mips/include/asm/mips-boards/launch.h
> @@ -3,6 +3,9 @@
> *
> */
>
> +#ifndef _ASM_MIPS_BOARDS_LAUNCH_H
> +#define _ASM_MIPS_BOARDS_LAUNCH_H
> +
> #ifndef _ASSEMBLER_
>
> struct cpulaunch {
> @@ -34,3 +37,5 @@ struct cpulaunch {
>
> /* Polling period in count cycles for secondary CPU's */
> #define LAUNCHPERIOD 10000
> +
> +#endif /* _ASM_MIPS_BOARDS_LAUNCH_H */
Thank you for fixing this.

Reviewed-by: Ilya Lipnitskiy <[email protected]>

2021-05-25 13:51:59

by Thomas Bogendoerfer

[permalink] [raw]
Subject: Re: [PATCH] MIPS: launch.h: add include guard to prevent build errors

On Thu, May 20, 2021 at 10:13:43PM -0700, Randy Dunlap wrote:
> arch/mips/include/asm/mips-boards/launch.h needs an include guard
> to prevent it from being #included more than once.
> Prevents these build errors:
>
> In file included from ../arch/mips/mti-malta/malta-amon.c:16:
> ../arch/mips/include/asm/mips-boards/launch.h:8:8: error: redefinition of 'struct cpulaunch'
> 8 | struct cpulaunch {
> | ^~~~~~~~~
> In file included from ../arch/mips/include/asm/mips-cps.h:13,
> from ../arch/mips/include/asm/smp-ops.h:16,
> from ../arch/mips/include/asm/smp.h:21,
> from ../include/linux/smp.h:114,
> from ../arch/mips/mti-malta/malta-amon.c:12:
> ../arch/mips/include/asm/mips-boards/launch.h:8:8: note: originally defined here
> 8 | struct cpulaunch {
> | ^~~~~~~~~
> make[3]: [../scripts/Makefile.build:273: arch/mips/mti-malta/malta-amon.o] Error 1 (ignored)
>
> Fixes: 6decd1aad15f ("MIPS: add support for buggy MT7621S core detection")
> Signed-off-by: Randy Dunlap <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Cc: Thomas Bogendoerfer <[email protected]>
> Cc: [email protected]
> Cc: Ilya Lipnitskiy <[email protected]>
> ---
> arch/mips/include/asm/mips-boards/launch.h | 5 +++++
> 1 file changed, 5 insertions(+)

applied to mips-fixes.

Thomas.

--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]