[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <272782f8-e17f-4f92-9d20-cbee790b4c7f@linux.intel.com>
Date: Mon, 8 Jan 2024 16:37:35 +0800
From: Binbin Wu <binbin.wu@...ux.intel.com>
To: Yi Liu <yi.l.liu@...el.com>
Cc: alex.williamson@...hat.com, jgg@...dia.com, kevin.tian@...el.com,
robin.murphy@....com, baolu.lu@...ux.intel.com, joro@...tes.org,
cohuck@...hat.com, eric.auger@...hat.com, nicolinc@...dia.com,
kvm@...r.kernel.org, mjrosato@...ux.ibm.com, chao.p.peng@...ux.intel.com,
yi.y.sun@...ux.intel.com, peterx@...hat.com, jasowang@...hat.com,
shameerali.kolothum.thodi@...wei.com, lulu@...hat.com,
suravee.suthikulpanit@....com, iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
zhenzhong.duan@...el.com, joao.m.martins@...cle.com, xin.zeng@...el.com,
yan.y.zhao@...el.com
Subject: Re: [PATCH v6 3/6] iommu: Add iommu_copy_struct_from_user_array
helper
On 11/17/2023 9:07 PM, Yi Liu wrote:
> +
> +/**
> + * iommu_copy_struct_from_user_array - Copy iommu driver specific user space
> + * data from an iommu_user_data_array
> + * @kdst: Pointer to an iommu driver specific user data that is defined in
> + * include/uapi/linux/iommufd.h
> + * @user_array: Pointer to a struct iommu_user_data_array for a user space array
> + * @data_type: The data type of the @kdst. Must match with @user_array->type
> + * @index: Index to offset the location in the array to copy user data from
> + * @min_last: The last memember of the data structure @kdst points in the
s/memember/member/
> + * initial version.
> + * Return 0 for success, otherwise -error.
> + */
> +#define iommu_copy_struct_from_user_array(kdst, user_array, data_type, \
> + index, min_last) \
> + __iommu_copy_struct_from_user_array(kdst, user_array, data_type, \
> + index, sizeof(*kdst), \
> + offsetofend(typeof(*kdst), \
> + min_last))
> +
> /**
> * struct iommu_ops - iommu ops and capabilities
> * @capable: check capability
Powered by blists - more mailing lists