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]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux