[v2,12/16] acl: add define guards to avoid multi-inclusion
Checks
Commit Message
Supplement define guards to prevent multiple inclusion.
It should noted that there is an exceptional case:
lib/acl/acl_run_avx512_common.h is designed to be included
several times.
Signed-off-by: Weiguo Li <liwg06@foxmail.com>
---
lib/acl/acl_run_altivec.h | 5 +++++
lib/acl/acl_run_avx2.h | 5 +++++
lib/acl/acl_run_avx512x16.h | 5 +++++
lib/acl/acl_run_avx512x8.h | 5 +++++
lib/acl/acl_run_neon.h | 5 +++++
lib/acl/acl_run_sse.h | 5 +++++
6 files changed, 30 insertions(+)
Comments
> Supplement define guards to prevent multiple inclusion.
> It should noted that there is an exceptional case:
> lib/acl/acl_run_avx512_common.h is designed to be included
> several times.
>
> Signed-off-by: Weiguo Li <liwg06@foxmail.com>
> ---
> lib/acl/acl_run_altivec.h | 5 +++++
> lib/acl/acl_run_avx2.h | 5 +++++
> lib/acl/acl_run_avx512x16.h | 5 +++++
> lib/acl/acl_run_avx512x8.h | 5 +++++
> lib/acl/acl_run_neon.h | 5 +++++
> lib/acl/acl_run_sse.h | 5 +++++
> 6 files changed, 30 insertions(+)
Do we really need these changes?
All these headers are internal ones for acl_run_*.c and not
supposed to be included multiple times anyway.
On Wed, 9 Feb 2022 09:42:28 +0000, Ananyev, Konstantin wrote:
>
> Do we really need these changes?
> All these headers are internal ones for acl_run_*.c and not
> supposed to be included multiple times anyway.
>
Got it.
This v2 series are superseded.
I've updated it by a new verision v3[1] which focus only on "rte_xxx.h".
Sorry to bother... >_<|||
-Weiguo
[1]http://patches.dpdk.org/project/dpdk/list/?series=21554
@@ -3,6 +3,9 @@
* Copyright (C) IBM Corporation 2016.
*/
+#ifndef ACL_RUN_ALTIVEC_H
+#define ACL_RUN_ALTIVEC_H
+
#include "acl_run.h"
#include "acl_vect.h"
@@ -300,3 +303,5 @@ search_altivec_4(const struct rte_acl_ctx *ctx, const uint8_t **data,
return 0;
}
+
+#endif /* ACL_RUN_ALTIVEC_H */
@@ -2,6 +2,9 @@
* Copyright(c) 2010-2014 Intel Corporation
*/
+#ifndef ACL_RUN_AVX2_H
+#define ACL_RUN_AVX2_H
+
#include "acl_run_sse.h"
static const rte_ymm_t ymm_match_mask = {
@@ -253,3 +256,5 @@ search_avx2x16(const struct rte_acl_ctx *ctx, const uint8_t **data,
return 0;
}
+
+#endif /* ACL_RUN_AVX2_H */
@@ -2,6 +2,9 @@
* Copyright(c) 2020 Intel Corporation
*/
+#ifndef ACL_RUN_AVX512X16_H
+#define ACL_RUN_AVX512X16_H
+
/*
* Defines required by "acl_run_avx512_common.h".
* Note that all of them has to be undefined by the end
@@ -337,3 +340,5 @@ search_avx512x16x2(const struct rte_acl_ctx *ctx, const uint8_t **data,
#undef _SC_
#undef _T_mask
#undef _T_simd
+
+#endif /* ACL_RUN_AVX512X16_H */
@@ -2,6 +2,9 @@
* Copyright(c) 2020 Intel Corporation
*/
+#ifndef ACL_RUN_AVX512X8_H
+#define ACL_RUN_AVX512X8_H
+
/*
* Defines required by "acl_run_avx512_common.h".
* Note that all of them has to be undefined by the end
@@ -251,3 +254,5 @@ search_avx512x8x2(const struct rte_acl_ctx *ctx, const uint8_t **data,
#undef _SC_
#undef _T_mask
#undef _T_simd
+
+#endif /* ACL_RUN_AVX512X8_H */
@@ -2,6 +2,9 @@
* Copyright(c) 2015 Cavium, Inc
*/
+#ifndef ACL_RUN_NEON_H
+#define ACL_RUN_NEON_H
+
#include "acl_run.h"
#include "acl_vect.h"
@@ -259,3 +262,5 @@ search_neon_4(const struct rte_acl_ctx *ctx, const uint8_t **data,
return 0;
}
+
+#endif /* ACL_RUN_NEON_H */
@@ -2,6 +2,9 @@
* Copyright(c) 2010-2014 Intel Corporation
*/
+#ifndef ACL_RUN_SSE_H
+#define ACL_RUN_SSE_H
+
#include "acl_run.h"
#include "acl_vect.h"
@@ -326,3 +329,5 @@ search_sse_4(const struct rte_acl_ctx *ctx, const uint8_t **data,
return 0;
}
+
+#endif /* ACL_RUN_SSE_H */