Skip to contentSkip to conversation

iommu: Make iommu_release_device() static

PATCH Applied Jason Gunthorpe 3 participants 3 messages Apr 12, 2023 – Apr 14, 2023 IOMMU

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu: Make iommu_release_device() static

This is not called outside the core code, and indeed cannot be called correctly outside the bus notifier. Make it static.

---
 drivers/iommu/iommu.c | 3 ++-
 include/linux/iommu.h | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/iommu.c +2 -1
index 7abee83610b6c9..435fc902df1984 100644
@@ -87,6 +87,7 @@ static const char * const iommu_group_resv_type_string[] = {
 
 static int iommu_bus_notifier(struct notifier_block *nb,
 			      unsigned long action, void *data);
+static void iommu_release_device(struct device *dev);
 static int iommu_alloc_default_domain(struct iommu_group *group,
 				      struct device *dev);
 static struct iommu_domain *__iommu_domain_alloc(struct bus_type *bus,
@@ -493,7 +494,7 @@ static void __iommu_group_release_device(struct iommu_group *group,
 	kobject_put(group->devices_kobj);
 }
 
-void iommu_release_device(struct device *dev)
+static void iommu_release_device(struct device *dev)
 {
 	struct iommu_group *group = dev->iommu_group;
 	struct group_device *device;
include/linux/iommu.h +0 -1
index 54f535ff9868af..c892e06f8357ee 100644
@@ -699,7 +699,6 @@ static inline void dev_iommu_priv_set(struct device *dev, void *priv)
 }
 
 int iommu_probe_device(struct device *dev);
-void iommu_release_device(struct device *dev);
 
 int iommu_dev_enable_feature(struct device *dev, enum iommu_dev_features f);
 int iommu_dev_disable_feature(struct device *dev, enum iommu_dev_features f);

base-commit: 43a31380ed6e16ad08675de5e68b5e4d05cf8716

Signature · 1 line
2.40.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Jason Gunthorpe

This is not called outside the core code, and indeed cannot be called correctly outside the bus notifier. Make it static.

Quoted 41 lines
---
  drivers/iommu/iommu.c | 3 ++-
  include/linux/iommu.h | 1 -
  2 files changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/iommu.c +2 -1
index 7abee83610b6c9..435fc902df1984 100644
@@ -87,6 +87,7 @@ static const char * const iommu_group_resv_type_string[] = {
 
  static int iommu_bus_notifier(struct notifier_block *nb,
  			      unsigned long action, void *data);
+static void iommu_release_device(struct device *dev);
  static int iommu_alloc_default_domain(struct iommu_group *group,
  				      struct device *dev);
  static struct iommu_domain *__iommu_domain_alloc(struct bus_type *bus,
@@ -493,7 +494,7 @@ static void __iommu_group_release_device(struct iommu_group *group,
  	kobject_put(group->devices_kobj);
  }
 
-void iommu_release_device(struct device *dev)
+static void iommu_release_device(struct device *dev)
  {
  	struct iommu_group *group = dev->iommu_group;
  	struct group_device *device;
include/linux/iommu.h +0 -1
index 54f535ff9868af..c892e06f8357ee 100644
@@ -699,7 +699,6 @@ static inline void dev_iommu_priv_set(struct device *dev, void *priv)
  }
 
  int iommu_probe_device(struct device *dev);
-void iommu_release_device(struct device *dev);
 
  int iommu_dev_enable_feature(struct device *dev, enum iommu_dev_features f);
  int iommu_dev_disable_feature(struct device *dev, enum iommu_dev_features f);

base-commit: 43a31380ed6e16ad08675de5e68b5e4d05cf8716

maintainer Applied
#2 lore raw
In reply to Jason Gunthorpe
Quoted 8 lines · Jason Gunthorpe

This is not called outside the core code, and indeed cannot be called correctly outside the bus notifier. Make it static.

---
 drivers/iommu/iommu.c | 3 ++-
 include/linux/iommu.h | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.