diff mbox series

[net-next,4/4] net: hns3: delete unnecessary vf value judgement when get vport id

Message ID 20220927111205.18060-5-huangguangbin2@huawei.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: hns3: cleanup and optimization | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Guangbin Huang Sept. 27, 2022, 11:12 a.m. UTC
The hdev->vport->vport_id is equal to hdev->vport[0].vport_id, so
delete unnecessary vf value judgement.

Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 6962a9d69cf8..b566c0d782ad 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -6487,8 +6487,6 @@  static bool hclge_is_cls_flower_active(struct hnae3_handle *handle)
 static int hclge_fd_parse_ring_cookie(struct hclge_dev *hdev, u64 ring_cookie,
 				      u16 *vport_id, u8 *action, u16 *queue_id)
 {
-	struct hclge_vport *vport = hdev->vport;
-
 	if (ring_cookie == RX_CLS_FLOW_DISC) {
 		*action = HCLGE_FD_ACTION_DROP_PACKET;
 	} else {
@@ -6506,7 +6504,7 @@  static int hclge_fd_parse_ring_cookie(struct hclge_dev *hdev, u64 ring_cookie,
 			return -EINVAL;
 		}
 
-		*vport_id = vf ? hdev->vport[vf].vport_id : vport->vport_id;
+		*vport_id = hdev->vport[vf].vport_id;
 		tqps = hdev->vport[vf].nic.kinfo.num_tqps;
 
 		if (ring >= tqps) {