Commit 0a0f547d authored by Chengchang Tang's avatar Chengchang Tang Committed by Juan Zhou
Browse files

RDMA/hns: Use complete parentheses in macros

driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9FIHP



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

Use complete parentheses to ensure that macro expansion does
not produce unexpected results.

Signed-off-by: default avatarChengchang Tang <tangchengchang@huawei.com>
Signed-off-by: default avatarJuan Zhou <zhoujuan51@h-partners.com>
parent 017106ac
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -57,16 +57,16 @@ enum {
};

#define check_whether_bt_num_3(type, hop_num) \
	(type < HEM_TYPE_MTT && hop_num == 2)
	((type) < HEM_TYPE_MTT && (hop_num) == 2)

#define check_whether_bt_num_2(type, hop_num) \
	((type < HEM_TYPE_MTT && hop_num == 1) || \
	(type >= HEM_TYPE_MTT && hop_num == 2))
	(((type) < HEM_TYPE_MTT && (hop_num) == 1) || \
	((type) >= HEM_TYPE_MTT && (hop_num) == 2))

#define check_whether_bt_num_1(type, hop_num) \
	((type < HEM_TYPE_MTT && hop_num == HNS_ROCE_HOP_NUM_0) || \
	(type >= HEM_TYPE_MTT && hop_num == 1) || \
	(type >= HEM_TYPE_MTT && hop_num == HNS_ROCE_HOP_NUM_0))
	(((type) < HEM_TYPE_MTT && (hop_num) == HNS_ROCE_HOP_NUM_0) || \
	((type) >= HEM_TYPE_MTT && (hop_num) == 1) || \
	((type) >= HEM_TYPE_MTT && (hop_num) == HNS_ROCE_HOP_NUM_0))

struct hns_roce_hem {
	void *buf;