qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v11 10/22] vfio iommu type1: Add support for med


From: Dong Jia Shi
Subject: Re: [Qemu-devel] [PATCH v11 10/22] vfio iommu type1: Add support for mediated devices
Date: Mon, 14 Nov 2016 10:49:10 +0800
User-agent: Mutt/1.7.0 (2016-08-17)

* Kirti Wankhede <address@hidden> [2016-11-05 02:40:44 +0530]:

Hi Kirti,

[...]
> diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
> index 8d64528dcc22..e511073446a0 100644
> --- a/drivers/vfio/vfio_iommu_type1.c
> +++ b/drivers/vfio/vfio_iommu_type1.c
[...]

> +static int vfio_pfn_account(struct vfio_addr_space *addr_space,
> +                         unsigned long pfn)
> +{
> +     struct vfio_pfn *p;
> +     int ret = 1;
> +
> +     mutex_lock(&addr_space->pfn_list_lock);
> +     p = vfio_find_pfn(addr_space, pfn);
> +     if (p)
> +             ret = 0;
> +     mutex_unlock(&addr_space->pfn_list_lock);
> +     return ret;
> +}
We could save a local variables(@ret) here by:
        return (p ? 0 : 1);

> +
>  struct vwork {
>       struct mm_struct        *mm;
>       long                    npage;
[...]

-- 
Dong Jia




reply via email to

[Prev in Thread] Current Thread [Next in Thread]