Re: [PATCH v8 2/5] hisi_acc_vfio_pci: extract public functions for container_of

From: Jason Gunthorpe
Date: Fri Mar 10 2023 - 12:18:45 EST


On Fri, Feb 17, 2023 at 04:48:28PM +0800, Longfang Liu wrote:
> In the current driver, vdev is obtained from struct
> hisi_acc_vf_core_device through the container_of function.
> This method is used in many places in the driver. In order to
> reduce this repetitive operation, I extracted a public function
> to replace it.
>
> Signed-off-by: Longfang Liu <liulongfang@xxxxxxxxxx>
> ---
> .../vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 21 ++++++++++---------
> 1 file changed, 11 insertions(+), 10 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

Jason