瀏覽代碼

iommu/amd: Use standard bitmap operation to set bitmap

It will be more readable and safer than the old setting.

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Baoquan He 9 年之前
父節點
當前提交
5c87f62dd1
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/iommu/amd_iommu_init.c

+ 2 - 1
drivers/iommu/amd_iommu_init.c

@@ -20,6 +20,7 @@
 #include <linux/pci.h>
 #include <linux/pci.h>
 #include <linux/acpi.h>
 #include <linux/acpi.h>
 #include <linux/list.h>
 #include <linux/list.h>
+#include <linux/bitmap.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/syscore_ops.h>
 #include <linux/syscore_ops.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
@@ -2285,7 +2286,7 @@ static int __init early_amd_iommu_init(void)
 	 * never allocate domain 0 because its used as the non-allocated and
 	 * never allocate domain 0 because its used as the non-allocated and
 	 * error value placeholder
 	 * error value placeholder
 	 */
 	 */
-	amd_iommu_pd_alloc_bitmap[0] = 1;
+	__set_bit(0, amd_iommu_pd_alloc_bitmap);
 
 
 	spin_lock_init(&amd_iommu_pd_lock);
 	spin_lock_init(&amd_iommu_pd_lock);