Re: [PATCH v4 01/23] iommufd/viommu: Add driver-allocated vDEVICE support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 15, 2025 at 05:42:46AM +0000, Tian, Kevin wrote:
> > From: Nicolin Chen <nicolinc@xxxxxxxxxx>
> > Sent: Friday, May 9, 2025 11:02 AM
> > 
> > +
> > +#define iommufd_vdevice_alloc(viommu, drv_struct, member)                      \
> > +	({                                                                     \
> > +		drv_struct *ret;                                               \
> > +									       \
> > +		static_assert(__same_type(struct iommufd_viommu,
> > *viommu));    \
> > +		static_assert(__same_type(struct iommufd_vdevice,              \
> > +					  ((drv_struct *)NULL)->member));
> > \
> > +		static_assert(offsetof(drv_struct, member.obj) == 0);          \
> > +		ret = (drv_struct *)_iommufd_object_alloc(                     \
> > +			viommu->ictx, sizeof(drv_struct),
> > IOMMUFD_OBJ_VDEVICE);\
> > +		if (!IS_ERR(ret)) {                                            \
> > +			ret->member.viommu = viommu;                           \
> > +			ret->member.ictx = viommu->ictx;                       \
> > +		}                                                              \
> > +		ret;                                                           \
> > +	})
> 
> viommu->ictx is set in patch5, so logically this is better put
> after that.
> 
> Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>

OK. Will rearrange a bit.

Thanks
Nicolin




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux