Skip to content

Commit

Permalink
AMD IOMMU: replace memset with __GFP_ZERO in alloc_coherent
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joerg Roedel authored and Ingo Molnar committed Sep 19, 2008
1 parent 13d9fea commit c97ac53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c97ac53

Please sign in to comment.