AMD IOMMU: replace memset with __GFP_ZERO in alloc_coherent

Remove the memset and use __GFP_ZERO at allocation time instead.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Joerg Roedel 2008-09-11 10:59:15 +02:00 committed by Ingo Molnar
parent 13d9fead3d
commit c97ac5359e

View File

@ -1176,11 +1176,11 @@ static void *alloc_coherent(struct device *dev, size_t size,
if (!get_device_resources(dev, &iommu, &domain, &devid))
flag &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
flag |= __GFP_ZERO;
virt_addr = (void *)__get_free_pages(flag, get_order(size));
if (!virt_addr)
return 0;
memset(virt_addr, 0, size);
paddr = virt_to_phys(virt_addr);
if (!iommu || !domain) {