Commit 60262b10 authored by Lijun Ou's avatar Lijun Ou Committed by Jason Gunthorpe

RDMA/hns: Fix coding style issues

Fix some coding style issuses without changing logic of codes, most of the
modification is unreasonable line breaks and alignments.

Link: https://lore.kernel.org/r/1578313276-29080-8-git-send-email-liweihang@huawei.comSigned-off-by: default avatarLijun Ou <oulijun@huawei.com>
Signed-off-by: default avatarLang Cheng <chenglang@huawei.com>
Signed-off-by: default avatarWeihang Li <liweihang@huawei.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent d800c93b
This diff is collapsed.
...@@ -90,7 +90,7 @@ static int hns_roce_add_gid(const struct ib_gid_attr *attr, void **context) ...@@ -90,7 +90,7 @@ static int hns_roce_add_gid(const struct ib_gid_attr *attr, void **context)
static int hns_roce_del_gid(const struct ib_gid_attr *attr, void **context) static int hns_roce_del_gid(const struct ib_gid_attr *attr, void **context)
{ {
struct hns_roce_dev *hr_dev = to_hr_dev(attr->device); struct hns_roce_dev *hr_dev = to_hr_dev(attr->device);
struct ib_gid_attr zattr = { }; struct ib_gid_attr zattr = {};
u8 port = attr->port_num - 1; u8 port = attr->port_num - 1;
int ret; int ret;
...@@ -259,9 +259,10 @@ static int hns_roce_query_port(struct ib_device *ib_dev, u8 port_num, ...@@ -259,9 +259,10 @@ static int hns_roce_query_port(struct ib_device *ib_dev, u8 port_num,
mtu = iboe_get_mtu(net_dev->mtu); mtu = iboe_get_mtu(net_dev->mtu);
props->active_mtu = mtu ? min(props->max_mtu, mtu) : IB_MTU_256; props->active_mtu = mtu ? min(props->max_mtu, mtu) : IB_MTU_256;
props->state = (netif_running(net_dev) && netif_carrier_ok(net_dev)) ? props->state = netif_running(net_dev) && netif_carrier_ok(net_dev) ?
IB_PORT_ACTIVE : IB_PORT_DOWN; IB_PORT_ACTIVE :
props->phys_state = (props->state == IB_PORT_ACTIVE) ? IB_PORT_DOWN;
props->phys_state = props->state == IB_PORT_ACTIVE ?
IB_PORT_PHYS_STATE_LINK_UP : IB_PORT_PHYS_STATE_LINK_UP :
IB_PORT_PHYS_STATE_DISABLED; IB_PORT_PHYS_STATE_DISABLED;
...@@ -503,8 +504,7 @@ static int hns_roce_register_device(struct hns_roce_dev *hr_dev) ...@@ -503,8 +504,7 @@ static int hns_roce_register_device(struct hns_roce_dev *hr_dev)
(1ULL << IB_USER_VERBS_CMD_QUERY_QP) | (1ULL << IB_USER_VERBS_CMD_QUERY_QP) |
(1ULL << IB_USER_VERBS_CMD_DESTROY_QP); (1ULL << IB_USER_VERBS_CMD_DESTROY_QP);
ib_dev->uverbs_ex_cmd_mask |= ib_dev->uverbs_ex_cmd_mask |= (1ULL << IB_USER_VERBS_EX_CMD_MODIFY_CQ);
(1ULL << IB_USER_VERBS_EX_CMD_MODIFY_CQ);
if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_REREG_MR) { if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_REREG_MR) {
ib_dev->uverbs_cmd_mask |= (1ULL << IB_USER_VERBS_CMD_REREG_MR); ib_dev->uverbs_cmd_mask |= (1ULL << IB_USER_VERBS_CMD_REREG_MR);
...@@ -590,10 +590,12 @@ static int hns_roce_init_hem(struct hns_roce_dev *hr_dev) ...@@ -590,10 +590,12 @@ static int hns_roce_init_hem(struct hns_roce_dev *hr_dev)
if (hns_roce_check_whether_mhop(hr_dev, HEM_TYPE_CQE)) { if (hns_roce_check_whether_mhop(hr_dev, HEM_TYPE_CQE)) {
ret = hns_roce_init_hem_table(hr_dev, ret = hns_roce_init_hem_table(hr_dev,
&hr_dev->mr_table.mtt_cqe_table, &hr_dev->mr_table.mtt_cqe_table,
HEM_TYPE_CQE, hr_dev->caps.mtt_entry_sz, HEM_TYPE_CQE,
hr_dev->caps.mtt_entry_sz,
hr_dev->caps.num_cqe_segs, 1); hr_dev->caps.num_cqe_segs, 1);
if (ret) { if (ret) {
dev_err(dev, "Failed to init MTT CQE context memory, aborting.\n"); dev_err(dev,
"Failed to init CQE context memory, aborting.\n");
goto err_unmap_cqe; goto err_unmap_cqe;
} }
} }
...@@ -698,8 +700,7 @@ static int hns_roce_init_hem(struct hns_roce_dev *hr_dev) ...@@ -698,8 +700,7 @@ static int hns_roce_init_hem(struct hns_roce_dev *hr_dev)
} }
if (hr_dev->caps.qpc_timer_entry_sz) { if (hr_dev->caps.qpc_timer_entry_sz) {
ret = hns_roce_init_hem_table(hr_dev, ret = hns_roce_init_hem_table(hr_dev, &hr_dev->qpc_timer_table,
&hr_dev->qpc_timer_table,
HEM_TYPE_QPC_TIMER, HEM_TYPE_QPC_TIMER,
hr_dev->caps.qpc_timer_entry_sz, hr_dev->caps.qpc_timer_entry_sz,
hr_dev->caps.num_qpc_timer, 1); hr_dev->caps.num_qpc_timer, 1);
...@@ -711,8 +712,7 @@ static int hns_roce_init_hem(struct hns_roce_dev *hr_dev) ...@@ -711,8 +712,7 @@ static int hns_roce_init_hem(struct hns_roce_dev *hr_dev)
} }
if (hr_dev->caps.cqc_timer_entry_sz) { if (hr_dev->caps.cqc_timer_entry_sz) {
ret = hns_roce_init_hem_table(hr_dev, ret = hns_roce_init_hem_table(hr_dev, &hr_dev->cqc_timer_table,
&hr_dev->cqc_timer_table,
HEM_TYPE_CQC_TIMER, HEM_TYPE_CQC_TIMER,
hr_dev->caps.cqc_timer_entry_sz, hr_dev->caps.cqc_timer_entry_sz,
hr_dev->caps.num_cqc_timer, 1); hr_dev->caps.num_cqc_timer, 1);
...@@ -727,8 +727,7 @@ static int hns_roce_init_hem(struct hns_roce_dev *hr_dev) ...@@ -727,8 +727,7 @@ static int hns_roce_init_hem(struct hns_roce_dev *hr_dev)
err_unmap_qpc_timer: err_unmap_qpc_timer:
if (hr_dev->caps.qpc_timer_entry_sz) if (hr_dev->caps.qpc_timer_entry_sz)
hns_roce_cleanup_hem_table(hr_dev, hns_roce_cleanup_hem_table(hr_dev, &hr_dev->qpc_timer_table);
&hr_dev->qpc_timer_table);
err_unmap_ctx: err_unmap_ctx:
if (hr_dev->caps.sccc_entry_sz) if (hr_dev->caps.sccc_entry_sz)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment