From: Junxin Chen chenjunxin1@huawei.com
driver inclusion category: bugfix bugzilla: NA CVE: NA
----------------------------------
Currently, CONFIG_HNS3_DCB is configed as y default, but in some cases, it may not be set.
This patch fixes an compile error when CONFIG_HNS3_DCB is not set.
Signed-off-by: Junxin Chen chenjunxin1@huawei.com Reviewed-by: Zhong Zhaohui zhongzhaohui@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/hisilicon/hns3/Makefile | 2 +- .../hisilicon/hns3/hns3_cae/hns3_cae_dcb.h | 25 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/Makefile b/drivers/net/ethernet/hisilicon/hns3/Makefile index a17983c..0844a4f 100644 --- a/drivers/net/ethernet/hisilicon/hns3/Makefile +++ b/drivers/net/ethernet/hisilicon/hns3/Makefile @@ -59,7 +59,6 @@ hclgevf-objs := hns3vf/hclgevf_main.o hns3vf/hclgevf_cmd.o hns3vf/hclgevf_mbx.o #add rally code HNS3_CAE_OBJS_PRIM = hns3_cae/hns3_cae_init.o \ hns3_cae/hns3_cae_lib.o \ - hns3_cae/hns3_cae_dcb.o \ hns3_cae/hns3_cae_dcqcn.o \ hns3_cae/hns3_cae_version.o \ hns3_cae/hns3_cae_reset.o \ @@ -86,3 +85,4 @@ HNS3_CAE_OBJS_EXT = hns3_cae/hns3_cae_dfx.o \ hns3_cae/hns3_cae_led.o obj-$(CONFIG_HNS3_CAE) += hns3_cae.o hns3_cae-objs := $(HNS3_CAE_OBJS_PRIM) $(HNS3_CAE_OBJS_EXT) +hns3_cae-$(CONFIG_HNS3_DCB) += hns3_cae/hns3_cae_dcb.o diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_dcb.h b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_dcb.h index c9437f5..f6466dba 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_dcb.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_dcb.h @@ -57,6 +57,7 @@ struct hns3_cae_dcb_info { struct hns3_cae_ets_cfg_param ets_cfg_info; };
+#ifdef CONFIG_HNS3_DCB int hns3_cae_dcb_cfg(const struct hns3_nic_priv *net_priv, void *buf_in, u32 in_size, void *buf_out, u32 out_size); @@ -66,4 +67,28 @@ int hns3_cae_dcb_ets_cfg(const struct hns3_nic_priv *net_priv, int hns3_cae_dcb_pfc_cfg(const struct hns3_nic_priv *net_priv, void *buf_in, u32 in_size, void *buf_out, u32 out_size); +#else +static inline int hns3_cae_dcb_cfg(const struct hns3_nic_priv *net_priv, + void *buf_in, u32 in_size, void *buf_out, + u32 out_size) +{ + return -EOPNOTSUPP; +} + +static inline int hns3_cae_dcb_ets_cfg(const struct hns3_nic_priv *net_priv, + void *buf_in, u32 in_size, + void *buf_out, u32 out_size) +{ + return -EOPNOTSUPP; +} + +static inline int hns3_cae_dcb_pfc_cfg(const struct hns3_nic_priv *net_priv, + void *buf_in, u32 in_size, + void *buf_out, u32 out_size) +{ + return -EOPNOTSUPP; +} + +#endif + #endif