Re: [Patch Part3 V1 19/22] iommu/vt-d: simplify intel_unmap_sg() and kill duplicated code

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

 



On Tue, 2014-04-22 at 15:07 +0800, Jiang Liu wrote:
> +       size_t size = 0;
> +#if 0
> +       /* current the third argument of intel_unmap_page is unsued */
> +       int i;
> +       struct scatterlist *sg;
>  
> -       freelist = domain_unmap(domain, start_pfn, last_pfn);
> +       for_each_sg(sglist, sg, nelems, i)
> +               size += sg->length;
> +#endif

Please don't do that. If you want to rely on the fact that
intel_unmap_page() currently just uses the size from the IOVA it finds,
then split it out into a separate function which explicitly does
precisely that. And call that new function from both intel_unmap_sg()
and intel_unmap_page().

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@xxxxxxxxx                              Intel Corporation

Attachment: smime.p7s
Description: S/MIME cryptographic signature


[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux