]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm: xilinx: Guard mach sys_proto.h against multiple inclusion
authorMichal Simek <michal.simek@amd.com>
Tue, 23 Jun 2026 12:53:26 +0000 (14:53 +0200)
committerMichal Simek <michal.simek@amd.com>
Wed, 8 Jul 2026 06:55:51 +0000 (08:55 +0200)
The Versal and Versal Gen 2 mach sys_proto.h headers lacked an include
guard. mach-versal/sys_proto.h additionally defines enum tcm_mode, so
including it twice in one translation unit fails to build with a
redeclaration error.

This is about to happen in firmware-zynqmp.c, which needs the SoC
prototypes unconditionally for the upcoming weak/strong multiboot and
bootmode accessors. Add the standard _ASM_ARCH_SYS_PROTO_H guard, as
already used by mach-zynqmp, so the header can be included more than once.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/1bf5b1d49abb271c2c5e7135837b740179b95553.1782219202.git.michal.simek@amd.com
arch/arm/mach-versal/include/mach/sys_proto.h
arch/arm/mach-versal2/include/mach/sys_proto.h

index a6dfa556966de7c793733cf1ad6afb2eb5cfc03c..b53e616e47beb1bbe1da88053d6cb8982471f65a 100644 (file)
@@ -3,6 +3,9 @@
  * Copyright 2016 - 2018 Xilinx, Inc.
  */
 
+#ifndef _ASM_ARCH_SYS_PROTO_H
+#define _ASM_ARCH_SYS_PROTO_H
+
 #include <linux/build_bug.h>
 
 enum tcm_mode {
@@ -13,3 +16,5 @@ enum tcm_mode {
 void initialize_tcm(enum tcm_mode mode);
 void tcm_init(enum tcm_mode mode);
 void mem_map_fill(void);
+
+#endif /* _ASM_ARCH_SYS_PROTO_H */
index cee1348862088657168c437d87e5c108c06a6252..3ed0b25be802ab43721709e48798fb0f31f80153 100644 (file)
@@ -4,8 +4,13 @@
  * Copyright (C) 2022 - 2024, Advanced Micro Devices, Inc.
  */
 
+#ifndef _ASM_ARCH_SYS_PROTO_H
+#define _ASM_ARCH_SYS_PROTO_H
+
 #include <linux/build_bug.h>
 #include <asm/armv8/mmu.h>
 
 void mem_map_fill(struct mm_region *bank_info, u32 num_banks);
 void fill_bd_mem_info(void);
+
+#endif /* _ASM_ARCH_SYS_PROTO_H */