Re: [PATCH v6 07/10] iommufd: Add a nested HW pagetable object

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

 



On Tue, Oct 24, 2023 at 08:06:06AM -0700, Yi Liu wrote:
>  static inline void iommufd_hw_pagetable_put(struct iommufd_ctx *ictx,
>  					    struct iommufd_hw_pagetable *hwpt)
>  {
> -	struct iommufd_hwpt_paging *hwpt_paging = to_hwpt_paging(hwpt);
> +	if (WARN_ON(hwpt->obj.type != IOMMUFD_OBJ_HWPT_PAGING &&
> +		    hwpt->obj.type != IOMMUFD_OBJ_HWPT_NESTED))
> +		return;

This is redundant, we have a C type, no need to check the type field
like this

Jason



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux