[13/16] eal: add define guards to avoid multi-inclusion

Message ID tencent_7B4F8F648AD0C42CF2DC9D4E4514E99C7C0A@qq.com (mailing list archive)
State Superseded, archived
Headers
Series [01/16] bus/dpaa: add define guards to avoid multiple inclusion |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Weiguo Li Feb. 6, 2022, 3:58 a.m. UTC
  Supplement define guards to prevent multiple inclusion.

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
---
 lib/eal/include/rte_eal_paging.h        | 5 +++++
 lib/eal/windows/include/rte_virt2phys.h | 5 +++++
 2 files changed, 10 insertions(+)
  

Comments

Dmitry Kozlyuk Feb. 6, 2022, 4:24 p.m. UTC | #1
2022-02-06 11:58 (UTC+0800), Weiguo Li:
> Supplement define guards to prevent multiple inclusion.
> 
> Signed-off-by: Weiguo Li <liwg06@foxmail.com>
> ---
>  lib/eal/include/rte_eal_paging.h        | 5 +++++
>  lib/eal/windows/include/rte_virt2phys.h | 5 +++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/lib/eal/include/rte_eal_paging.h b/lib/eal/include/rte_eal_paging.h
> index c60317d0f5..0ee5dd467f 100644
> --- a/lib/eal/include/rte_eal_paging.h
> +++ b/lib/eal/include/rte_eal_paging.h
> @@ -2,6 +2,9 @@
>   * Copyright(c) 2020 Dmitry Kozlyuk
>   */
>  
> +#ifndef _RTE_EAL_PAGING_H_
> +#define _RTE_EAL_PAGING_H_
> +
>  #include <stdint.h>
>  
>  #include <rte_compat.h>
> @@ -96,3 +99,5 @@ rte_mem_page_size(void);
>  __rte_internal
>  int
>  rte_mem_lock(const void *virt, size_t size);
> +
> +#endif /* _RTE_EAL_PAGING_H_ */
> diff --git a/lib/eal/windows/include/rte_virt2phys.h b/lib/eal/windows/include/rte_virt2phys.h
> index 4bb2b4aafe..06992f208d 100644
> --- a/lib/eal/windows/include/rte_virt2phys.h
> +++ b/lib/eal/windows/include/rte_virt2phys.h
> @@ -2,6 +2,9 @@
>   * Copyright (c) 2020 Dmitry Kozlyuk
>   */
>  
> +#ifndef _RTE_VIRT2PHYS_H_
> +#define _RTE_VIRT2PHYS_H_
> +
>  /**
>   * @file virt2phys driver interface
>   */
> @@ -32,3 +35,5 @@ DEFINE_GUID(GUID_DEVINTERFACE_VIRT2PHYS,
>   */
>  #define IOCTL_VIRT2PHYS_TRANSLATE CTL_CODE( \
>  	VIRT2PHYS_DEVTYPE, 0x800, METHOD_BUFFERED, FILE_ANY_ACCESS)
> +
> +#endif /* _RTE_VIRT2PHYS_H_ */

Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>

Probably should have:

Fixes: 2a5d547a4a9b ("eal/windows: implement basic memory management")
Cc: dmitry.kozliuk@gmail.com
  

Patch

diff --git a/lib/eal/include/rte_eal_paging.h b/lib/eal/include/rte_eal_paging.h
index c60317d0f5..0ee5dd467f 100644
--- a/lib/eal/include/rte_eal_paging.h
+++ b/lib/eal/include/rte_eal_paging.h
@@ -2,6 +2,9 @@ 
  * Copyright(c) 2020 Dmitry Kozlyuk
  */
 
+#ifndef _RTE_EAL_PAGING_H_
+#define _RTE_EAL_PAGING_H_
+
 #include <stdint.h>
 
 #include <rte_compat.h>
@@ -96,3 +99,5 @@  rte_mem_page_size(void);
 __rte_internal
 int
 rte_mem_lock(const void *virt, size_t size);
+
+#endif /* _RTE_EAL_PAGING_H_ */
diff --git a/lib/eal/windows/include/rte_virt2phys.h b/lib/eal/windows/include/rte_virt2phys.h
index 4bb2b4aafe..06992f208d 100644
--- a/lib/eal/windows/include/rte_virt2phys.h
+++ b/lib/eal/windows/include/rte_virt2phys.h
@@ -2,6 +2,9 @@ 
  * Copyright (c) 2020 Dmitry Kozlyuk
  */
 
+#ifndef _RTE_VIRT2PHYS_H_
+#define _RTE_VIRT2PHYS_H_
+
 /**
  * @file virt2phys driver interface
  */
@@ -32,3 +35,5 @@  DEFINE_GUID(GUID_DEVINTERFACE_VIRT2PHYS,
  */
 #define IOCTL_VIRT2PHYS_TRANSLATE CTL_CODE( \
 	VIRT2PHYS_DEVTYPE, 0x800, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+#endif /* _RTE_VIRT2PHYS_H_ */