Skip to content

Commit 68dd9d8

Browse files
bulwahnwilldeacon
authored andcommitted
iommu/vt-d: include conditionally on CONFIG_INTEL_IOMMU_SVM
Commit 6ee1b77 ("iommu/vt-d: Add svm/sva invalidate function") introduced intel_iommu_sva_invalidate() when CONFIG_INTEL_IOMMU_SVM. This function uses the dedicated static variable inv_type_granu_table and functions to_vtd_granularity() and to_vtd_size(). These parts are unused when !CONFIG_INTEL_IOMMU_SVM, and hence, make CC=clang W=1 warns with an -Wunused-function warning. Include these parts conditionally on CONFIG_INTEL_IOMMU_SVM. Fixes: 6ee1b77 ("iommu/vt-d: Add svm/sva invalidate function") Signed-off-by: Lukas Bulwahn <[email protected]> Acked-by: Lu Baolu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent f8394f2 commit 68dd9d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5387,6 +5387,7 @@ static void intel_iommu_aux_detach_device(struct iommu_domain *domain,
53875387
aux_domain_remove_dev(to_dmar_domain(domain), dev);
53885388
}
53895389

5390+
#ifdef CONFIG_INTEL_IOMMU_SVM
53905391
/*
53915392
* 2D array for converting and sanitizing IOMMU generic TLB granularity to
53925393
* VT-d granularity. Invalidation is typically included in the unmap operation
@@ -5433,7 +5434,6 @@ static inline u64 to_vtd_size(u64 granu_size, u64 nr_granules)
54335434
return order_base_2(nr_pages);
54345435
}
54355436

5436-
#ifdef CONFIG_INTEL_IOMMU_SVM
54375437
static int
54385438
intel_iommu_sva_invalidate(struct iommu_domain *domain, struct device *dev,
54395439
struct iommu_cache_invalidate_info *inv_info)

0 commit comments

Comments
 (0)