From: Junxian Huang huangjunxian6@hisilicon.com
driver inclusion category: bugfix 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: Junxian Huang huangjunxian6@hisilicon.com --- drivers/infiniband/hw/hns/hns_roce_bond.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_bond.c b/drivers/infiniband/hw/hns/hns_roce_bond.c index 06ffcf64c73a..f9f57f10135f 100644 --- a/drivers/infiniband/hw/hns/hns_roce_bond.c +++ b/drivers/infiniband/hw/hns/hns_roce_bond.c @@ -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) { 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; 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; if (net_dev && upper_dev != get_upper_dev_from_ndev(net_dev)) { - bond_grp->slave_map_diff |= (1 << i); - bond_grp->slave_map &= ~(1 << i); + bond_grp->slave_map_diff |= (1U << i); + bond_grp->slave_map &= ~(1U << i); } } return; @@ -689,8 +689,8 @@ static void hns_roce_bond_info_update(struct hns_roce_bond_group *bond_grp, if (hr_dev) { func_idx = PCI_FUNC(hr_dev->pci_dev->devfn); if (!bond_grp->bond_func_info[func_idx].net_dev) { - bond_grp->slave_map_diff |= (1 << func_idx); - bond_grp->slave_map |= (1 << func_idx); + bond_grp->slave_map_diff |= (1U << func_idx); + bond_grp->slave_map |= (1U << func_idx); priv = hr_dev->priv;
bond_grp->bond_func_info[func_idx].net_dev =