Skip to content

Commit

Permalink
iommu: Make iommu_sva_domain_alloc() static
Browse files Browse the repository at this point in the history
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]>
(cherry picked from commit b5c29fb)
Signed-off-by: Matthew R. Ochs <[email protected]>
Acked-by: Kai-Heng Feng <[email protected]>
Acked-by: Koba Ko <[email protected]>
Signed-off-by: Matthew R. Ochs <[email protected]>
  • Loading branch information
LuBaolu authored and nvmochs committed Oct 18, 2024
1 parent 487578f commit 63e993b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 4 additions & 2 deletions drivers/iommu/iommu-sva.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "iommu-priv.h"

static DEFINE_MUTEX(iommu_sva_lock);
static struct iommu_domain *iommu_sva_domain_alloc(struct device *dev,
struct mm_struct *mm);

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

struct iommu_domain *iommu_sva_domain_alloc(struct device *dev,
struct mm_struct *mm)
static struct iommu_domain *iommu_sva_domain_alloc(struct device *dev,
struct mm_struct *mm)
{
const struct iommu_ops *ops = dev_iommu_ops(dev);
struct iommu_domain *domain;
Expand Down
8 changes: 0 additions & 8 deletions include/linux/iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1519,8 +1519,6 @@ struct iommu_sva *iommu_sva_bind_device(struct device *dev,
struct mm_struct *mm);
void iommu_sva_unbind_device(struct iommu_sva *handle);
u32 iommu_sva_get_pasid(struct iommu_sva *handle);
struct iommu_domain *iommu_sva_domain_alloc(struct device *dev,
struct mm_struct *mm);
#else
static inline struct iommu_sva *
iommu_sva_bind_device(struct device *dev, struct mm_struct *mm)
Expand All @@ -1545,12 +1543,6 @@ static inline u32 mm_get_enqcmd_pasid(struct mm_struct *mm)
}

static inline void mm_pasid_drop(struct mm_struct *mm) {}

static inline struct iommu_domain *
iommu_sva_domain_alloc(struct device *dev, struct mm_struct *mm)
{
return NULL;
}
#endif /* CONFIG_IOMMU_SVA */

#ifdef CONFIG_IOMMU_IOPF
Expand Down

0 comments on commit 63e993b

Please sign in to comment.