提交 5db7938f 编写于 作者: L liweihang 提交者: Xie XiuQi

net: hns3: avoid bitwise operation of two booleans

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

It's unsafe to use bitwise operator on booleans, so we use if-statement
instead.

Feature or Bugfix: Bugfix
Signed-off-by: Nliweihang <liweihang@huawei.com>
Reviewed-by: Nlipeng <lipeng321@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 a3af6708
...@@ -2136,7 +2136,8 @@ static int hclge_cfg_mac_speed_dup_hw(struct hclge_dev *hdev, int speed, ...@@ -2136,7 +2136,8 @@ static int hclge_cfg_mac_speed_dup_hw(struct hclge_dev *hdev, int speed,
hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_CONFIG_SPEED_DUP, false); hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_CONFIG_SPEED_DUP, false);
hnae3_set_bit(req->speed_dup, HCLGE_CFG_DUPLEX_B, !!duplex); if (duplex)
hnae3_set_bit(req->speed_dup, HCLGE_CFG_DUPLEX_B, 1);
switch (speed) { switch (speed) {
case HCLGE_MAC_SPEED_10M: case HCLGE_MAC_SPEED_10M:
...@@ -6508,7 +6509,9 @@ static int hclge_set_umv_space(struct hclge_dev *hdev, u16 space_size, ...@@ -6508,7 +6509,9 @@ static int hclge_set_umv_space(struct hclge_dev *hdev, u16 space_size,
req = (struct hclge_umv_spc_alc_cmd *)desc.data; req = (struct hclge_umv_spc_alc_cmd *)desc.data;
hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_MAC_VLAN_ALLOCATE, false); hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_MAC_VLAN_ALLOCATE, false);
hnae3_set_bit(req->allocate, HCLGE_UMV_SPC_ALC_B, !is_alloc); if (!is_alloc)
hnae3_set_bit(req->allocate, HCLGE_UMV_SPC_ALC_B, 1);
req->space_size = cpu_to_le32(space_size); req->space_size = cpu_to_le32(space_size);
ret = hclge_cmd_send(&hdev->hw, &desc, 1); ret = hclge_cmd_send(&hdev->hw, &desc, 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册