Skip to content

Commit b5c29fb

Browse files
LuBaolujoergroedel
authored andcommitted
iommu: Make iommu_sva_domain_alloc() static
iommu_sva_domain_alloc() is only called in iommu-sva.c, hence make it static. On the other hand, iommu_sva_domain_alloc() should not return NULL anymore after commit <80af5a452024> ("iommu: Add ops->domain_alloc_sva()"), the removal of inline code avoids potential confusion. Fixes: 80af5a4 ("iommu: Add ops->domain_alloc_sva()") Signed-off-by: Lu Baolu <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 83a7eef commit b5c29fb

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

drivers/iommu/iommu-sva.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include "iommu-priv.h"
1111

1212
static DEFINE_MUTEX(iommu_sva_lock);
13+
static struct iommu_domain *iommu_sva_domain_alloc(struct device *dev,
14+
struct mm_struct *mm);
1315

1416
/* Allocate a PASID for the mm within range (inclusive) */
1517
static struct iommu_mm_data *iommu_alloc_mm_data(struct mm_struct *mm, struct device *dev)
@@ -277,8 +279,8 @@ static int iommu_sva_iopf_handler(struct iopf_group *group)
277279
return 0;
278280
}
279281

280-
struct iommu_domain *iommu_sva_domain_alloc(struct device *dev,
281-
struct mm_struct *mm)
282+
static struct iommu_domain *iommu_sva_domain_alloc(struct device *dev,
283+
struct mm_struct *mm)
282284
{
283285
const struct iommu_ops *ops = dev_iommu_ops(dev);
284286
struct iommu_domain *domain;

include/linux/iommu.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,8 +1527,6 @@ struct iommu_sva *iommu_sva_bind_device(struct device *dev,
15271527
struct mm_struct *mm);
15281528
void iommu_sva_unbind_device(struct iommu_sva *handle);
15291529
u32 iommu_sva_get_pasid(struct iommu_sva *handle);
1530-
struct iommu_domain *iommu_sva_domain_alloc(struct device *dev,
1531-
struct mm_struct *mm);
15321530
#else
15331531
static inline struct iommu_sva *
15341532
iommu_sva_bind_device(struct device *dev, struct mm_struct *mm)
@@ -1553,12 +1551,6 @@ static inline u32 mm_get_enqcmd_pasid(struct mm_struct *mm)
15531551
}
15541552

15551553
static inline void mm_pasid_drop(struct mm_struct *mm) {}
1556-
1557-
static inline struct iommu_domain *
1558-
iommu_sva_domain_alloc(struct device *dev, struct mm_struct *mm)
1559-
{
1560-
return NULL;
1561-
}
15621554
#endif /* CONFIG_IOMMU_SVA */
15631555

15641556
#ifdef CONFIG_IOMMU_IOPF

0 commit comments

Comments
 (0)