iommu/vt-d: include conditionally on CONFIG_INTEL_IOMMU_SVM
authorLukas Bulwahn <lukas.bulwahn@gmail.com>
Sun, 15 Nov 2020 20:59:51 +0000 (21:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:53:14 +0000 (11:53 +0100)
commit1a94c18952af51783056e5de12c007717b738472
treede6e71be3938187920da3a7da917991be14bdec7
parent1f1e14d91704015aa74155b32e2a2a4a05a82ae4
iommu/vt-d: include conditionally on CONFIG_INTEL_IOMMU_SVM

[ Upstream commit 68dd9d89eaf56dfab8d46bf25610aa4650247617 ]

Commit 6ee1b77ba3ac ("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: 6ee1b77ba3ac ("iommu/vt-d: Add svm/sva invalidate function")
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20201115205951.20698-1-lukas.bulwahn@gmail.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/intel/iommu.c