Commit 5aba6c47 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Joerg Roedel

iommu/vt-d: Switch to bitmap_zalloc()

Switch to bitmap_zalloc() to show clearly what we are allocating.
Besides that it returns pointer of bitmap type instead of opaque void *.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 9e98c678
...@@ -548,8 +548,7 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu) ...@@ -548,8 +548,7 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu)
goto out_free_table; goto out_free_table;
} }
bitmap = kcalloc(BITS_TO_LONGS(INTR_REMAP_TABLE_ENTRIES), bitmap = bitmap_zalloc(INTR_REMAP_TABLE_ENTRIES, GFP_ATOMIC);
sizeof(long), GFP_ATOMIC);
if (bitmap == NULL) { if (bitmap == NULL) {
pr_err("IR%d: failed to allocate bitmap\n", iommu->seq_id); pr_err("IR%d: failed to allocate bitmap\n", iommu->seq_id);
goto out_free_pages; goto out_free_pages;
...@@ -616,7 +615,7 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu) ...@@ -616,7 +615,7 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu)
return 0; return 0;
out_free_bitmap: out_free_bitmap:
kfree(bitmap); bitmap_free(bitmap);
out_free_pages: out_free_pages:
__free_pages(pages, INTR_REMAP_PAGE_ORDER); __free_pages(pages, INTR_REMAP_PAGE_ORDER);
out_free_table: out_free_table:
...@@ -640,7 +639,7 @@ static void intel_teardown_irq_remapping(struct intel_iommu *iommu) ...@@ -640,7 +639,7 @@ static void intel_teardown_irq_remapping(struct intel_iommu *iommu)
} }
free_pages((unsigned long)iommu->ir_table->base, free_pages((unsigned long)iommu->ir_table->base,
INTR_REMAP_PAGE_ORDER); INTR_REMAP_PAGE_ORDER);
kfree(iommu->ir_table->bitmap); bitmap_free(iommu->ir_table->bitmap);
kfree(iommu->ir_table); kfree(iommu->ir_table);
iommu->ir_table = NULL; iommu->ir_table = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment