vDPA/ifcvf: retire ifcvf_private_to_vf
authorZhu Lingshan <lingshan.zhu@intel.com>
Fri, 25 Nov 2022 14:57:23 +0000 (22:57 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 21 Feb 2023 00:26:55 +0000 (19:26 -0500)
This commit retires ifcvf_private_to_vf, because
the vf is already a member of the adapter,
so it could be easily addressed by adapter->vf.

Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
Message-Id: <20221125145724.1129962-12-lingshan.zhu@intel.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/ifcvf/ifcvf_base.h
drivers/vdpa/ifcvf/ifcvf_main.c

index 25bd4e927b2740ec491ce194835818ffb546707e..d41e255c581bb91db3377e61086e75a95a8f2c5f 100644 (file)
@@ -38,9 +38,6 @@
 #define IFCVF_DBG(pdev, fmt, ...)      dev_dbg(&pdev->dev, fmt, ##__VA_ARGS__)
 #define IFCVF_INFO(pdev, fmt, ...)     dev_info(&pdev->dev, fmt, ##__VA_ARGS__)
 
-#define ifcvf_private_to_vf(adapter) \
-       (((struct ifcvf_adapter *)adapter)->vf)
-
 /* all vqs and config interrupt has its own vector */
 #define MSIX_VECTOR_PER_VQ_AND_CONFIG          1
 /* all vqs share a vector, and config interrupt has a separate vector */
index d5036f49f161ae1feaad2b7e9bf31fb28a0023b3..c34e0f88e9610baa76c2d49154ff44a07571374b 100644 (file)
@@ -346,9 +346,9 @@ static int ifcvf_request_irq(struct ifcvf_hw *vf)
        return 0;
 }
 
-static int ifcvf_start_datapath(void *private)
+static int ifcvf_start_datapath(struct ifcvf_adapter *adapter)
 {
-       struct ifcvf_hw *vf = ifcvf_private_to_vf(private);
+       struct ifcvf_hw *vf = adapter->vf;
        u8 status;
        int ret;
 
@@ -362,9 +362,9 @@ static int ifcvf_start_datapath(void *private)
        return ret;
 }
 
-static int ifcvf_stop_datapath(void *private)
+static int ifcvf_stop_datapath(struct ifcvf_adapter *adapter)
 {
-       struct ifcvf_hw *vf = ifcvf_private_to_vf(private);
+       struct ifcvf_hw *vf = adapter->vf;
        int i;
 
        for (i = 0; i < vf->nr_vring; i++)
@@ -377,7 +377,7 @@ static int ifcvf_stop_datapath(void *private)
 
 static void ifcvf_reset_vring(struct ifcvf_adapter *adapter)
 {
-       struct ifcvf_hw *vf = ifcvf_private_to_vf(adapter);
+       struct ifcvf_hw *vf = adapter->vf;
        int i;
 
        for (i = 0; i < vf->nr_vring; i++) {