[v2,08/16] net/tap: add define guards to avoid multi-inclusion

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

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

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

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
---
 drivers/net/tap/tap_bpf_insns.h | 5 +++++
 drivers/net/tap/tap_log.h       | 5 +++++
 2 files changed, 10 insertions(+)
  

Comments

Stephen Hemminger Feb. 9, 2022, 6:28 a.m. UTC | #1
On Wed,  9 Feb 2022 11:02:16 +0800
Weiguo Li <liwg06@foxmail.com> wrote:

> Supplement define guards to prevent multiple inclusion.
> 
> Signed-off-by: Weiguo Li <liwg06@foxmail.com>

This is a driver specific include, not required
  

Patch

diff --git a/drivers/net/tap/tap_bpf_insns.h b/drivers/net/tap/tap_bpf_insns.h
index 1a91bbad13..c190793b89 100644
--- a/drivers/net/tap/tap_bpf_insns.h
+++ b/drivers/net/tap/tap_bpf_insns.h
@@ -2,6 +2,9 @@ 
  * Copyright 2017 Mellanox Technologies, Ltd
  */
 
+#ifndef TAP_BPF_INSNS_H
+#define TAP_BPF_INSNS_H
+
 #include <tap_bpf.h>
 
 /* bpf_insn array matching cls_q section. See tap_bpf_program.c file */
@@ -1694,3 +1697,5 @@  static struct bpf_insn l3_l4_hash_insns[] = {
 	{0xbf,    0,    7,        0, 0x00000000},
 	{0x95,    0,    0,        0, 0x00000000},
 };
+
+#endif /* TAP_BPF_INSNS_H */
diff --git a/drivers/net/tap/tap_log.h b/drivers/net/tap/tap_log.h
index fa06843a4c..5e4f0ebabb 100644
--- a/drivers/net/tap/tap_log.h
+++ b/drivers/net/tap/tap_log.h
@@ -3,8 +3,13 @@ 
  * Copyright 2017 Mellanox Technologies, Ltd
  */
 
+#ifndef TAP_LOG_H
+#define TAP_LOG_H
+
 extern int tap_logtype;
 
 #define TAP_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, tap_logtype, "%s(): " fmt "\n", \
 		__func__, ## args)
+
+#endif /* TAP_LOG_H */