From: Robin Murphy robin.murphy@arm.com
stable inclusion from stable-v5.10.150 commit 9e6ba62d418d48ba4bf2b993b62d61f2de16ad50 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I6D0XA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=...
--------------------------------
[ Upstream commit 4f58330fcc8482aa90674e1f40f601e82f18ed4a ]
IOMMU_IOVA is intended to be an optional library for users to select as and when they desire. Since it can be a module now, this means that built-in code which has chosen not to select it should not fail to link if it happens to have selected as a module by someone else. Replace IS_ENABLED() with IS_REACHABLE() to do the right thing.
CC: Thierry Reding thierry.reding@gmail.com Reported-by: John Garry john.garry@huawei.com Fixes: 15bbdec3931e ("iommu: Make the iova library a module") Signed-off-by: Robin Murphy robin.murphy@arm.com Reviewed-by: Thierry Reding treding@nvidia.com Link: https://lore.kernel.org/r/548c2f683ca379aface59639a8f0cccc3a1ac050.166306922... Signed-off-by: Joerg Roedel jroedel@suse.de Signed-off-by: Sasha Levin sashal@kernel.org Signed-off-by: Jialin Zhang zhangjialin11@huawei.com --- include/linux/iova.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/iova.h b/include/linux/iova.h index 56a05c92820c..dfa51ae49666 100644 --- a/include/linux/iova.h +++ b/include/linux/iova.h @@ -133,7 +133,7 @@ static inline unsigned long iova_pfn(struct iova_domain *iovad, dma_addr_t iova) return iova >> iova_shift(iovad); }
-#if IS_ENABLED(CONFIG_IOMMU_IOVA) +#if IS_REACHABLE(CONFIG_IOMMU_IOVA) int iova_cache_get(void); void iova_cache_put(void);