Commit 1bc1f93a authored by Junxian Huang's avatar Junxian Huang Committed by Juan Zhou
Browse files

RDMA/hns: Cleanup of RoCE Bonding driver

driver inclusion
category: cleanup
bugzilla: https://gitee.com/openeuler/kernel/issues/I8HZ73



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

Cleanup for uninitialized value and applying bitwise to signed quantity
in RoCE Bonding driver.

Signed-off-by: default avatarJunxian Huang <huangjunxian6@hisilicon.com>
parent ebccb56b
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -256,7 +256,7 @@ static void hns_roce_set_bond(struct hns_roce_bond_group *bond_grp)
static void hns_roce_clear_bond(struct hns_roce_bond_group *bond_grp)
static void hns_roce_clear_bond(struct hns_roce_bond_group *bond_grp)
{
{
	u8 main_func_idx = PCI_FUNC(bond_grp->main_hr_dev->pci_dev->devfn);
	u8 main_func_idx = PCI_FUNC(bond_grp->main_hr_dev->pci_dev->devfn);
	struct hns_roce_dev *hr_dev;
	struct hns_roce_dev *hr_dev = NULL;
	struct net_device *net_dev;
	struct net_device *net_dev;
	int i, ret;
	int i, ret;


@@ -676,8 +676,8 @@ static void hns_roce_bond_info_update(struct hns_roce_bond_group *bond_grp,
			net_dev = bond_grp->bond_func_info[i].net_dev;
			net_dev = bond_grp->bond_func_info[i].net_dev;
			if (net_dev && upper_dev !=
			if (net_dev && upper_dev !=
				get_upper_dev_from_ndev(net_dev)) {
				get_upper_dev_from_ndev(net_dev)) {
				bond_grp->slave_map_diff |= (1 << i);
				bond_grp->slave_map_diff |= (1U << i);
				bond_grp->slave_map &= ~(1 << i);
				bond_grp->slave_map &= ~(1U << i);
			}
			}
		}
		}
		return;
		return;
@@ -689,8 +689,8 @@ static void hns_roce_bond_info_update(struct hns_roce_bond_group *bond_grp,
		if (hr_dev) {
		if (hr_dev) {
			func_idx = PCI_FUNC(hr_dev->pci_dev->devfn);
			func_idx = PCI_FUNC(hr_dev->pci_dev->devfn);
			if (!bond_grp->bond_func_info[func_idx].net_dev) {
			if (!bond_grp->bond_func_info[func_idx].net_dev) {
				bond_grp->slave_map_diff |= (1 << func_idx);
				bond_grp->slave_map_diff |= (1U << func_idx);
				bond_grp->slave_map |= (1 << func_idx);
				bond_grp->slave_map |= (1U << func_idx);
				priv = hr_dev->priv;
				priv = hr_dev->priv;


				bond_grp->bond_func_info[func_idx].net_dev =
				bond_grp->bond_func_info[func_idx].net_dev =