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

Message ID tencent_F57C116F3AA5DF60235C221031FF3C4DA708@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/netvsc/hn_nvs.h   | 5 +++++
 drivers/net/netvsc/hn_rndis.h | 5 +++++
 drivers/net/netvsc/hn_var.h   | 5 +++++
 3 files changed, 15 insertions(+)
  

Comments

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

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

Why bother these are just driver specific includes, not a public API
  
Bruce Richardson Feb. 9, 2022, 9:25 a.m. UTC | #2
On Tue, Feb 08, 2022 at 10:28:01PM -0800, Stephen Hemminger wrote:
> On Wed,  9 Feb 2022 11:02:14 +0800
> Weiguo Li <liwg06@foxmail.com> wrote:
> 
> > Supplement define guards to prevent multiple inclusion.
> > 
> > Signed-off-by: Weiguo Li <liwg06@foxmail.com>
> 
> Why bother these are just driver specific includes, not a public API

On the other hand, if this can be cleaned up globally in DPDK, why not also
fix the internal headers?
  

Patch

diff --git a/drivers/net/netvsc/hn_nvs.h b/drivers/net/netvsc/hn_nvs.h
index 3766d2ee34..125df08a21 100644
--- a/drivers/net/netvsc/hn_nvs.h
+++ b/drivers/net/netvsc/hn_nvs.h
@@ -3,6 +3,9 @@ 
  * All rights reserved.
  */
 
+#ifndef NETVSC_HN_NVS_H
+#define NETVSC_HN_NVS_H
+
 /*
  * The indirection table message is the largest message
  * received from host, and that is 112 bytes.
@@ -236,3 +239,5 @@  hn_nvs_send_sglist(struct vmbus_channel *chan,
 	return rte_vmbus_chan_send_sglist(chan, sg, sglen, nvs_msg, nvs_msglen,
 					  (uint64_t)sndc, need_sig);
 }
+
+#endif /* NETVSC_HN_NVS_H */
diff --git a/drivers/net/netvsc/hn_rndis.h b/drivers/net/netvsc/hn_rndis.h
index 9a8251fc2f..fc3364f8ce 100644
--- a/drivers/net/netvsc/hn_rndis.h
+++ b/drivers/net/netvsc/hn_rndis.h
@@ -1,5 +1,8 @@ 
 /* SPDX-License-Identifier: BSD-3-Clause */
 
+#ifndef NETVSC_HN_RNDIS_H
+#define NETVSC_HN_RNDIS_H
+
 #include "rndis.h"
 
 struct hn_data;
@@ -32,3 +35,5 @@  void hn_rndis_dump(const void *buf);
 #else
 #define hn_rndis_dump(buf)
 #endif
+
+#endif /* NETVSC_HN_RNDIS_H */
diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h
index fbb3995507..36b5a56d34 100644
--- a/drivers/net/netvsc/hn_var.h
+++ b/drivers/net/netvsc/hn_var.h
@@ -6,6 +6,9 @@ 
  * All rights reserved.
  */
 
+#ifndef NETVSC_HN_VAR_H
+#define NETVSC_HN_VAR_H
+
 #include <rte_eal_paging.h>
 #include <ethdev_driver.h>
 
@@ -283,3 +286,5 @@  int	hn_vf_reta_hash_update(struct rte_eth_dev *dev,
 int	hn_eth_rmv_event_callback(uint16_t port_id,
 				  enum rte_eth_event_type event __rte_unused,
 				  void *cb_arg, void *out __rte_unused);
+
+#endif /* NETVSC_HN_VAR_H */