From 3f6ac9fdfd3e751f2a8a67c236e2608d681f5682 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Tue, 21 Jul 2020 14:00:14 -0700 Subject: [PATCH] arm: add include guard for offset files MISRA-C directive 4.10 requires that files being included must prevent itself from being included more than once. So add include guards to the offset files, even though they are C source files. Signed-off-by: Daniel Leung --- arch/arm/core/offsets/offsets_aarch32.c | 5 +++++ arch/arm/core/offsets/offsets_aarch64.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/core/offsets/offsets_aarch32.c b/arch/arm/core/offsets/offsets_aarch32.c index 4a93a0ac647..3ff2ecf15bb 100644 --- a/arch/arm/core/offsets/offsets_aarch32.c +++ b/arch/arm/core/offsets/offsets_aarch32.c @@ -22,6 +22,9 @@ * completeness. */ +#ifndef _ARM_OFFSETS_INC_ +#define _ARM_OFFSETS_INC_ + #include #include #include @@ -88,3 +91,5 @@ GEN_ABSOLUTE_SYM(_K_THREAD_NO_FLOAT_SIZEOF, sizeof(struct k_thread) - #else GEN_ABSOLUTE_SYM(_K_THREAD_NO_FLOAT_SIZEOF, sizeof(struct k_thread)); #endif + +#endif /* _ARM_OFFSETS_INC_ */ diff --git a/arch/arm/core/offsets/offsets_aarch64.c b/arch/arm/core/offsets/offsets_aarch64.c index de20eac416d..a107af70b17 100644 --- a/arch/arm/core/offsets/offsets_aarch64.c +++ b/arch/arm/core/offsets/offsets_aarch64.c @@ -22,8 +22,13 @@ * completeness. */ +#ifndef _ARM_OFFSETS_INC_ +#define _ARM_OFFSETS_INC_ + #include #include #include GEN_OFFSET_SYM(_thread_arch_t, swap_return_value); + +#endif /* _ARM_OFFSETS_INC_ */