From: Junxian Huang huangjunxian6@hisilicon.com
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IAQEU6
----------------------------------------------------------------------
Fix sparse warnings: Should it be static?
Fixes: f44a2f97d82a ("RDMA/hns: Introduce DCA for RC QP") Fixes: 11ef2ec6aa7c ("RDMA/hns: Support DSCP of userspace") Fixes: e8e3f2da005e ("RDMA/hns: Support configure and query the CNP DSCP through sysfs") Fixes: 523f34d81ea7 ("RDMA/hns: Support congestion control algorithm parameter configuration") Signed-off-by: Junxian Huang huangjunxian6@hisilicon.com Signed-off-by: Xinghai Cen cenxinghai@h-partners.com --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 +-- drivers/infiniband/hw/hns/hns_roce_main.c | 2 +- drivers/infiniband/hw/hns/hns_roce_sysfs.c | 36 +++++++++++----------- 3 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 7b242c3c81f3..b0b1c079930d 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -5486,8 +5486,8 @@ static int fill_congest_field(struct ib_qp *ibqp, const struct ib_qp_attr *attr, return 0; }
-int hns_roce_hw_v2_get_dscp(struct hns_roce_dev *hr_dev, u8 dscp, - u8 *tc_mode, u8 *priority) +static int hns_roce_hw_v2_get_dscp(struct hns_roce_dev *hr_dev, u8 dscp, + u8 *tc_mode, u8 *priority) { struct hns_roce_v2_priv *priv = hr_dev->priv; struct hnae3_handle *handle = priv->handle; diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index aa527ba6da58..c587407986ed 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -913,7 +913,7 @@ static void hns_roce_unregister_device(struct hns_roce_dev *hr_dev, ib_unregister_device(&hr_dev->ib_dev); }
-const struct uapi_definition hns_roce_uapi_defs[] = { +static const struct uapi_definition hns_roce_uapi_defs[] = { UAPI_DEF_CHAIN(hns_roce_dca_uapi_defs), {} }; diff --git a/drivers/infiniband/hw/hns/hns_roce_sysfs.c b/drivers/infiniband/hw/hns/hns_roce_sysfs.c index 8950e7c4a2e4..ec266136d038 100644 --- a/drivers/infiniband/hw/hns/hns_roce_sysfs.c +++ b/drivers/infiniband/hw/hns/hns_roce_sysfs.c @@ -310,12 +310,12 @@ static umode_t scc_attr_is_visible(struct kobject *kobj, .max = _max, \ }
-#define HNS_PORT_CNP_PRI_ATTR_RW(_name, NAME) \ - struct hns_port_cnp_pri_attr hns_roce_port_attr_cnp_pri_##_name = \ +#define HNS_PORT_CNP_PRI_ATTR_RW(_name, NAME) \ + static struct hns_port_cnp_pri_attr hns_roce_port_attr_cnp_pri_##_name = \ __HNS_CNP_PRI_ATTR(_name, \ - HNS_ROCE_CNP_PRI_##NAME##_BIT_OFS, \ - HNS_ROCE_CNP_PRI_##NAME##_BIT_SZ, \ - HNS_ROCE_CNP_PRI_##NAME##_BIT_MASK, \ + HNS_ROCE_CNP_PRI_##NAME##_BIT_OFS, \ + HNS_ROCE_CNP_PRI_##NAME##_BIT_SZ, \ + HNS_ROCE_CNP_PRI_##NAME##_BIT_MASK, \ HNS_ROCE_CNP_PRI_##NAME##_MAX)
HNS_PORT_CNP_PRI_ATTR_RW(enable, ENABLE); @@ -342,11 +342,11 @@ static const struct attribute_group cnp_pri_param_group = { .max = _max, \ }
-#define HNS_PORT_DCQCN_CC_ATTR_RW(_name, NAME) \ - struct hns_port_cc_attr hns_roce_port_attr_dcqcn_##_name = \ - __HNS_SCC_ATTR(_name, HNS_ROCE_SCC_ALGO_DCQCN, \ - HNS_ROCE_DCQCN_##NAME##_OFS, \ - HNS_ROCE_DCQCN_##NAME##_SZ, \ +#define HNS_PORT_DCQCN_CC_ATTR_RW(_name, NAME) \ + static struct hns_port_cc_attr hns_roce_port_attr_dcqcn_##_name = \ + __HNS_SCC_ATTR(_name, HNS_ROCE_SCC_ALGO_DCQCN, \ + HNS_ROCE_DCQCN_##NAME##_OFS, \ + HNS_ROCE_DCQCN_##NAME##_SZ, \ 0, HNS_ROCE_DCQCN_##NAME##_MAX)
HNS_PORT_DCQCN_CC_ATTR_RW(ai, AI); @@ -382,11 +382,11 @@ static const struct attribute_group dcqcn_cc_param_group = { .is_visible = scc_attr_is_visible, };
-#define HNS_PORT_LDCP_CC_ATTR_RW(_name, NAME) \ - struct hns_port_cc_attr hns_roce_port_attr_ldcp_##_name = \ - __HNS_SCC_ATTR(_name, HNS_ROCE_SCC_ALGO_LDCP, \ - HNS_ROCE_LDCP_##NAME##_OFS, \ - HNS_ROCE_LDCP_##NAME##_SZ, \ +#define HNS_PORT_LDCP_CC_ATTR_RW(_name, NAME) \ + static struct hns_port_cc_attr hns_roce_port_attr_ldcp_##_name = \ + __HNS_SCC_ATTR(_name, HNS_ROCE_SCC_ALGO_LDCP, \ + HNS_ROCE_LDCP_##NAME##_OFS, \ + HNS_ROCE_LDCP_##NAME##_SZ, \ 0, HNS_ROCE_LDCP_##NAME##_MAX)
HNS_PORT_LDCP_CC_ATTR_RW(cwd0, CWD0); @@ -413,7 +413,7 @@ static const struct attribute_group ldcp_cc_param_group = { };
#define HNS_PORT_HC3_CC_ATTR_RW(_name, NAME) \ - struct hns_port_cc_attr hns_roce_port_attr_hc3_##_name = \ + static struct hns_port_cc_attr hns_roce_port_attr_hc3_##_name = \ __HNS_SCC_ATTR(_name, HNS_ROCE_SCC_ALGO_HC3, \ HNS_ROCE_HC3_##NAME##_OFS, \ HNS_ROCE_HC3_##NAME##_SZ, \ @@ -447,7 +447,7 @@ static const struct attribute_group hc3_cc_param_group = { };
#define HNS_PORT_DIP_CC_ATTR_RW(_name, NAME) \ - struct hns_port_cc_attr hns_roce_port_attr_dip_##_name = \ + static struct hns_port_cc_attr hns_roce_port_attr_dip_##_name = \ __HNS_SCC_ATTR(_name, HNS_ROCE_SCC_ALGO_DIP, \ HNS_ROCE_DIP_##NAME##_OFS, \ HNS_ROCE_DIP_##NAME##_SZ, \ @@ -486,7 +486,7 @@ static const struct attribute_group dip_cc_param_group = { .is_visible = scc_attr_is_visible, };
-const struct attribute_group *hns_attr_port_groups[] = { +static const struct attribute_group *hns_attr_port_groups[] = { &dcqcn_cc_param_group, &ldcp_cc_param_group, &hc3_cc_param_group,