[PATCH 03/10] HV: add #ifdef for include header file #ifdef


YanLiang
 

From: Chaohong guo <chaohong.guo@intel.com>

e820.h file has no ifdef protection for repeated/recursive inclusion.
Just add that.

Signed-off-by: Chaohong guo <chaohong.guo@intel.com>
---
hypervisor/include/arch/x86/e820.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/hypervisor/include/arch/x86/e820.h b/hypervisor/include/arch/x86/e820.h
index d932a2ef..8acb9a0d 100644
--- a/hypervisor/include/arch/x86/e820.h
+++ b/hypervisor/include/arch/x86/e820.h
@@ -4,6 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

+#ifndef _E820_H_
+#define _E820_H_
struct e820_mem_params {
uint64_t mem_bottom;
uint64_t mem_top;
@@ -43,3 +45,5 @@ const struct e820_mem_params *get_e820_mem_info(void);
#define NUM_E820_ENTRIES 5U
extern const struct e820_entry e820_default_entries[NUM_E820_ENTRIES];
#endif
+
+#endif /* _E820_H_ */
--
2.19.0


Eddie Dong
 

-----Original Message-----
From: acrn-dev@lists.projectacrn.org
[mailto:acrn-dev@lists.projectacrn.org] On Behalf Of YanLiang
Sent: Friday, December 21, 2018 12:31 PM
To: acrn-dev@lists.projectacrn.org
Cc: Guo, Chaohong <chaohong.guo@intel.com>
Subject: [acrn-dev] [PATCH 03/10] HV: add #ifdef for include header file

From: Chaohong guo <chaohong.guo@intel.com>

e820.h file has no ifdef protection for repeated/recursive inclusion.
Just add that.

Signed-off-by: Chaohong guo <chaohong.guo@intel.com>
---
hypervisor/include/arch/x86/e820.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/hypervisor/include/arch/x86/e820.h
b/hypervisor/include/arch/x86/e820.h
index d932a2ef..8acb9a0d 100644
--- a/hypervisor/include/arch/x86/e820.h
+++ b/hypervisor/include/arch/x86/e820.h
@@ -4,6 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

+#ifndef _E820_H_
+#define _E820_H_
MISRAC does not allow "_" for the 1st character of the name.

struct e820_mem_params {
uint64_t mem_bottom;
uint64_t mem_top;
@@ -43,3 +45,5 @@ const struct e820_mem_params
*get_e820_mem_info(void);
#define NUM_E820_ENTRIES 5U
extern const struct e820_entry
e820_default_entries[NUM_E820_ENTRIES];
#endif
+
+#endif /* _E820_H_ */
--
2.19.0