size_t len;
 };
 
-#define IS_IOMMU_CAP_DOMAIN_IN_CONTAINER(iommu)        \
-                                       (!list_empty(&iommu->domain_list))
-
 #define DIRTY_BITMAP_BYTES(n)  (ALIGN(n, BITS_PER_TYPE(u64)) / BITS_PER_BYTE)
 
 /*
         * already pinned and accounted. Accounting should be done if there is no
         * iommu capable domain in the container.
         */
-       do_accounting = !IS_IOMMU_CAP_DOMAIN_IN_CONTAINER(iommu);
+       do_accounting = list_empty(&iommu->domain_list);
 
        for (i = 0; i < npage; i++) {
                struct vfio_pfn *vpfn;
 
        mutex_lock(&iommu->lock);
 
-       do_accounting = !IS_IOMMU_CAP_DOMAIN_IN_CONTAINER(iommu);
+       do_accounting = list_empty(&iommu->domain_list);
        for (i = 0; i < npage; i++) {
                struct vfio_dma *dma;
                dma_addr_t iova;
        if (!dma->size)
                return 0;
 
-       if (!IS_IOMMU_CAP_DOMAIN_IN_CONTAINER(iommu))
+       if (list_empty(&iommu->domain_list))
                return 0;
 
        /*
        vfio_link_dma(iommu, dma);
 
        /* Don't pin and map if container doesn't contain IOMMU capable domain*/
-       if (!IS_IOMMU_CAP_DOMAIN_IN_CONTAINER(iommu))
+       if (list_empty(&iommu->domain_list))
                dma->size = size;
        else
                ret = vfio_pin_map_dma(iommu, dma, size);
                kfree(group);
 
                if (list_empty(&iommu->emulated_iommu_groups) &&
-                   !IS_IOMMU_CAP_DOMAIN_IN_CONTAINER(iommu)) {
+                   list_empty(&iommu->domain_list)) {
                        WARN_ON(iommu->notifier.head);
                        vfio_iommu_unmap_unpin_all(iommu);
                }