Commit 57c04562 authored by Junxian Huang's avatar Junxian Huang Committed by Chengchang Tang
Browse files

RDMA/hns: Fix "Should it be static?" warnings

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAQEU6



----------------------------------------------------------------------

Fix sparse warnings: Should it be static?

Fixes: f44a2f97 ("RDMA/hns: Introduce DCA for RC QP")
Fixes: 11ef2ec6 ("RDMA/hns: Support DSCP of userspace")
Fixes: e8e3f2da ("RDMA/hns: Support configure and query the CNP DSCP through sysfs")
Fixes: 523f34d8 ("RDMA/hns: Support congestion control algorithm parameter configuration")
Signed-off-by: default avatarJunxian Huang <huangjunxian6@hisilicon.com>
Signed-off-by: default avatarXinghai Cen <cenxinghai@h-partners.com>
parent 437697cd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5486,7 +5486,7 @@ 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,
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;
+1 −1
Original line number Diff line number Diff line
@@ -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),
	{}
};
+18 −18
Original line number Diff line number Diff line
@@ -311,7 +311,7 @@ static umode_t scc_attr_is_visible(struct kobject *kobj,
}

#define HNS_PORT_CNP_PRI_ATTR_RW(_name, NAME)						\
	struct hns_port_cnp_pri_attr hns_roce_port_attr_cnp_pri_##_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,				\
@@ -343,7 +343,7 @@ static const struct attribute_group cnp_pri_param_group = {
}

#define HNS_PORT_DCQCN_CC_ATTR_RW(_name, NAME)					\
	struct hns_port_cc_attr hns_roce_port_attr_dcqcn_##_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,				\
@@ -383,7 +383,7 @@ static const struct attribute_group dcqcn_cc_param_group = {
};

#define HNS_PORT_LDCP_CC_ATTR_RW(_name, NAME)					\
	struct hns_port_cc_attr hns_roce_port_attr_ldcp_##_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,				\
@@ -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,