lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 27 Sep 2022 19:12:05 +0800
From:   Guangbin Huang <huangguangbin2@...wei.com>
To:     <davem@...emloft.net>, <kuba@...nel.org>
CC:     <edumazet@...gle.com>, <pabeni@...hat.com>,
        <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <huangguangbin2@...wei.com>, <shenjian15@...wei.com>,
        <lanhao@...wei.com>
Subject: [PATCH net-next 4/4] net: hns3: delete unnecessary vf value judgement when get vport id

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@...wei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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) {
-- 
2.33.0

Powered by blists - more mailing lists