提交 b729f76f 编写于 作者: S shenhao 提交者: Yang Yingliang

net: hns3: splice two "if" logic as one

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

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

When checks tuple in hclge_fd_check_ext_tuple(), two nested "if" is used
as a logic judgment. It can be spliced as one,using "&&", which make code
more readability.
Signed-off-by: NGuojia Liao <liaoguojia@huawei.com>
Signed-off-by: Nshenhao <shenhao21@huawei.com>
Reviewed-by: NZhong Zhaohui <zhongzhaohui@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 30714f1f
...@@ -5513,10 +5513,9 @@ static int hclge_fd_check_ext_tuple(struct hclge_dev *hdev, ...@@ -5513,10 +5513,9 @@ static int hclge_fd_check_ext_tuple(struct hclge_dev *hdev,
if (!fs->h_ext.vlan_tci) if (!fs->h_ext.vlan_tci)
*unused_tuple |= BIT(INNER_VLAN_TAG_FST); *unused_tuple |= BIT(INNER_VLAN_TAG_FST);
if (fs->m_ext.vlan_tci) { if (fs->m_ext.vlan_tci &&
if (be16_to_cpu(fs->h_ext.vlan_tci) >= VLAN_N_VID) be16_to_cpu(fs->h_ext.vlan_tci) >= VLAN_N_VID)
return -EINVAL; return -EINVAL;
}
} else { } else {
*unused_tuple |= BIT(INNER_VLAN_TAG_FST); *unused_tuple |= BIT(INNER_VLAN_TAG_FST);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册