Skip to content

Commit

Permalink
MIPS: launch.h: add include guard to prevent build errors
Browse files Browse the repository at this point in the history
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: 6decd1a ("MIPS: add support for buggy MT7621S core detection")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org
Cc: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Reviewed-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
  • Loading branch information
Randy Dunlap authored and Thomas Bogendoerfer committed May 25, 2021
1 parent ff4cff9 commit 6855adc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/mips/include/asm/mips-boards/launch.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
*
*/

#ifndef _ASM_MIPS_BOARDS_LAUNCH_H
#define _ASM_MIPS_BOARDS_LAUNCH_H

#ifndef _ASSEMBLER_

struct cpulaunch {
Expand Down Expand Up @@ -34,3 +37,5 @@ struct cpulaunch {

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

#endif /* _ASM_MIPS_BOARDS_LAUNCH_H */

0 comments on commit 6855adc

Please sign in to comment.