From: Hao Lan <lanhao@huawei.com>
To: <netdev@vger.kernel.org>
Cc: <yisen.zhuang@huawei.com>, <salil.mehta@huawei.com>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <richardcochran@gmail.com>,
<lanhao@huawei.com>, <wangpeiyang1@huawei.com>,
<shenjian15@huawei.com>, <chenhao418@huawei.com>,
<simon.horman@corigine.com>, <wangjie125@huawei.com>,
<yuanjilin@cdjrlc.com>, <cai.huoqing@linux.dev>,
<xiujianfeng@huawei.com>
Subject: [PATCH net-next 2/4] net: hns3: fix hns3 driver header file not self-contained issue
Date: Mon, 15 May 2023 21:46:41 +0800 [thread overview]
Message-ID: <20230515134643.48314-3-lanhao@huawei.com> (raw)
In-Reply-To: <20230515134643.48314-1-lanhao@huawei.com>
From: Hao Chen <chenhao418@huawei.com>
Hns3 driver header file uses the structure of other files, but does
not include corresponding file, which causes a check warning that the
header file is not self-contained by clang-tidy checker.
For example,
Header file 'hclge_mbx.h' is not self contained.
It should include following headers: (1) 'hclgevf_main.h'
due to symbols 'struct hclgevf_dev'. The main source file is hns3_enet.c
Therefore, the required header file is included in the header file, and
the structure declaration is added to the header file to avoid cyclic
dependency of the header file.
Signed-off-by: Hao Chen <chenhao418@huawei.com>
Signed-off-by: Hao Lan <lanhao@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h | 4 +++-
.../hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.h | 2 ++
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 3 +++
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.h | 5 ++++-
4 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h b/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
index abcd7877f7d2..487216aeae50 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
@@ -7,6 +7,8 @@
#include <linux/mutex.h>
#include <linux/types.h>
+struct hclgevf_dev;
+
enum HCLGE_MBX_OPCODE {
HCLGE_MBX_RESET = 0x01, /* (VF -> PF) assert reset */
HCLGE_MBX_ASSERTING_RESET, /* (PF -> VF) PF is asserting reset */
@@ -233,7 +235,7 @@ struct hclgevf_mbx_arq_ring {
__le16 msg_q[HCLGE_MBX_MAX_ARQ_MSG_NUM][HCLGE_MBX_MAX_ARQ_MSG_SIZE];
};
-struct hclge_dev;
+struct hclge_vport;
#define HCLGE_MBX_OPCODE_MAX 256
struct hclge_mbx_ops_param {
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.h b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.h
index a46350162ee8..7aff1a544cf4 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.h
@@ -7,6 +7,8 @@
#include <linux/etherdevice.h>
#include "hnae3.h"
+struct hclge_comm_hw;
+
/* each tqp has TX & RX two queues */
#define HCLGE_COMM_QUEUE_PAIR_SIZE 2
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
index 88af34bbee34..1b360aa52e5d 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
@@ -13,6 +13,9 @@
struct iphdr;
struct ipv6hdr;
+struct gre_base_hdr;
+struct tcphdr;
+struct udphdr;
enum hns3_nic_state {
HNS3_NIC_STATE_TESTING,
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.h
index bbee74cd8404..bceb61c791a1 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.h
@@ -8,8 +8,11 @@
#include <linux/net_tstamp.h>
#include <linux/types.h>
-struct hclge_dev;
struct ifreq;
+struct ethtool_ts_info;
+
+struct hnae3_handle;
+struct hclge_dev;
#define HCLGE_PTP_REG_OFFSET 0x29000
--
2.30.0
next prev parent reply other threads:[~2023-05-15 13:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-15 13:46 [PATCH net-next 0/4] net: hns3: There are some cleanup for the HNS3 ethernet driver Hao Lan
2023-05-15 13:46 ` [PATCH net-next 1/4] net: hns3: refine the tcam key convert handle Hao Lan
2023-05-15 15:51 ` Simon Horman
2023-05-15 20:04 ` Simon Horman
2023-05-15 13:46 ` Hao Lan [this message]
2023-05-15 20:02 ` [PATCH net-next 2/4] net: hns3: fix hns3 driver header file not self-contained issue Simon Horman
2023-05-16 13:12 ` Hao Lan
2023-05-16 14:12 ` Simon Horman
2023-05-15 13:46 ` [PATCH net-next 3/4] net: hns3: fix strncpy() not using dest-buf length as length issue Hao Lan
2023-05-15 19:57 ` Simon Horman
2023-05-16 13:09 ` Hao Lan
2023-05-16 14:11 ` Simon Horman
2023-05-16 15:35 ` Hao Lan
2023-05-16 19:05 ` Simon Horman
2023-05-15 13:46 ` [PATCH net-next 4/4] net: hns3: clear hns unused parameter alarm Hao Lan
2023-05-15 20:01 ` Simon Horman
2023-05-16 12:22 ` Hao Lan
-- strict thread matches above, loose matches on Subject: below --
2022-09-27 11:12 [PATCH net-next 0/4] net: hns3: cleanup and optimization Guangbin Huang
2022-09-27 11:12 ` [PATCH net-next 2/4] net: hns3: fix hns3 driver header file not self-contained issue Guangbin Huang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230515134643.48314-3-lanhao@huawei.com \
--to=lanhao@huawei.com \
--cc=cai.huoqing@linux.dev \
--cc=chenhao418@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=salil.mehta@huawei.com \
--cc=shenjian15@huawei.com \
--cc=simon.horman@corigine.com \
--cc=wangjie125@huawei.com \
--cc=wangpeiyang1@huawei.com \
--cc=xiujianfeng@huawei.com \
--cc=yisen.zhuang@huawei.com \
--cc=yuanjilin@cdjrlc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).