Skip to contentSkip to conversation

ACPI/IORT: Code cleanups

PATCH Applied Zenghui Yu 4 participants 9 messages Aug 18, 2020 – Sep 7, 2020

Subsystems (2)
lore
Share & tools
lore

Zenghui Yu

author
#0 lore raw

v2 cover ACPI/IORT: Code cleanups

* From v1 [1]:
- As pointed out by Hanjun, remove two now unused inline functions. Compile tested with CONFIG_IOMMU_API is not selected.

[1] https://lore.kernel.org/r/[email protected]

Zenghui Yu (2):
ACPI/IORT: Drop the unused @ops of iort_add_device_replay() ACPI/IORT: Remove the unused inline functions

 drivers/acpi/arm64/iort.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
Signature · 1 line
2.19.1
author
#1 lore raw

PATCH v2 1/2 ACPI/IORT: Drop the unused @ops of iort_add_device_replay()

Since commit d2e1a003af56 ("ACPI/IORT: Don't call iommu_ops->add_device directly"), we use the IOMMU core API to replace a direct invoke of the specified callback. The parameter @ops has therefore became unused. Let's drop it.

---
 drivers/acpi/arm64/iort.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/acpi/arm64/iort.c +3 -5
index ec782e4a0fe4..a0ece0e201b2 100644
@@ -811,8 +811,7 @@ static inline const struct iommu_ops *iort_fwspec_iommu_ops(struct device *dev)
 	return (fwspec && fwspec->ops) ? fwspec->ops : NULL;
 }
 
-static inline int iort_add_device_replay(const struct iommu_ops *ops,
-					 struct device *dev)
+static inline int iort_add_device_replay(struct device *dev)
 {
 	int err = 0;
 
@@ -1072,7 +1071,7 @@ const struct iommu_ops *iort_iommu_configure_id(struct device *dev,
 	 */
 	if (!err) {
 		ops = iort_fwspec_iommu_ops(dev);
-		err = iort_add_device_replay(ops, dev);
+		err = iort_add_device_replay(dev);
 	}
 
 	/* Ignore all other errors apart from EPROBE_DEFER */
@@ -1089,8 +1088,7 @@ const struct iommu_ops *iort_iommu_configure_id(struct device *dev,
 #else
 static inline const struct iommu_ops *iort_fwspec_iommu_ops(struct device *dev)
 { return NULL; }
-static inline int iort_add_device_replay(const struct iommu_ops *ops,
-					 struct device *dev)
+static inline int iort_add_device_replay(struct device *dev)
 { return 0; }
 int iort_iommu_msi_get_resv_regions(struct device *dev, struct list_head *head)
 { return 0; }
Signature · 1 line
2.19.1
author
#2 lore raw

PATCH v2 2/2 ACPI/IORT: Remove the unused inline functions

In reply to Zenghui Yu

Since commit 8212688600ed ("ACPI/IORT: Fix build error when IOMMU_SUPPORT is disabled"), iort_fwspec_iommu_ops() and iort_add_device_replay() are not needed anymore when CONFIG_IOMMU_API is not selected. Let's remove them.

---
 drivers/acpi/arm64/iort.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/acpi/arm64/iort.c +0 -4
index a0ece0e201b2..e670785a6201 100644
@@ -1086,10 +1086,6 @@ const struct iommu_ops *iort_iommu_configure_id(struct device *dev,
 }
 
 #else
-static inline const struct iommu_ops *iort_fwspec_iommu_ops(struct device *dev)
-{ return NULL; }
-static inline int iort_add_device_replay(struct device *dev)
-{ return 0; }
 int iort_iommu_msi_get_resv_regions(struct device *dev, struct list_head *head)
 { return 0; }
 const struct iommu_ops *iort_iommu_configure_id(struct device *dev,
Signature · 1 line
2.19.1
maintainer Acked-by on the v2 series
#3 lore raw
In reply to Zenghui Yu
Quoted 4 lines · Zenghui Yu

* From v1 [1]:
- As pointed out by Hanjun, remove two now unused inline functions. Compile tested with CONFIG_IOMMU_API is not selected.

Quoted 8 lines

[1] https://lore.kernel.org/r/[email protected]

Zenghui Yu (2):
ACPI/IORT: Drop the unused @ops of iort_add_device_replay() ACPI/IORT: Remove the unused inline functions

  drivers/acpi/arm64/iort.c | 10 ++--------
  1 file changed, 2 insertions(+), 8 deletions(-)

Nice cleanup.

maintainer
#4 lore raw

+Cc Will

Quoted 11 lines · Hanjun Guo
Quoted 10 lines · Zenghui Yu

* From v1 [1]:
   - As pointed out by Hanjun, remove two now unused inline functions. Compile tested with CONFIG_IOMMU_API is not selected.

[1] https://lore.kernel.org/r/[email protected]

Zenghui Yu (2):
   ACPI/IORT: Drop the unused @ops of iort_add_device_replay() ACPI/IORT: Remove the unused inline functions

Quoted 6 lines
Quoted 2 lines

  drivers/acpi/arm64/iort.c | 10 ++--------

  1 file changed, 2 insertions(+), 8 deletions(-)

Nice cleanup.

Will, would you mind taking this patch set via ARM64 tree?

Thanks
Hanjun

maintainer
#5 lore raw
Quoted 14 lines · Hanjun Guo

+Cc Will

Quoted 11 lines · Hanjun Guo
Quoted 10 lines · Zenghui Yu

* From v1 [1]:
   - As pointed out by Hanjun, remove two now unused inline functions. Compile tested with CONFIG_IOMMU_API is not selected.

[1] https://lore.kernel.org/r/[email protected]

Zenghui Yu (2):
   ACPI/IORT: Drop the unused @ops of iort_add_device_replay() ACPI/IORT: Remove the unused inline functions

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

  drivers/acpi/arm64/iort.c | 10 ++--------

  1 file changed, 2 insertions(+), 8 deletions(-)

Nice cleanup.

Will, would you mind taking this patch set via ARM64 tree?

Sure, no problem. I'll queue this for 5.10 later this week.

Will

maintainer
#6 lore raw
Quoted 18 lines · Will Deacon
Quoted 17 lines · Hanjun Guo

+Cc Will

Quoted 14 lines · Hanjun Guo
Quoted 12 lines · Zenghui Yu

* From v1 [1]:
   - As pointed out by Hanjun, remove two now unused inline functions. Compile tested with CONFIG_IOMMU_API is not selected.

[1] https://lore.kernel.org/r/[email protected]

Zenghui Yu (2):
   ACPI/IORT: Drop the unused @ops of iort_add_device_replay() ACPI/IORT: Remove the unused inline functions

   drivers/acpi/arm64/iort.c | 10 ++--------
   1 file changed, 2 insertions(+), 8 deletions(-)
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Nice cleanup.

Will, would you mind taking this patch set via ARM64 tree?

Sure, no problem. I'll queue this for 5.10 later this week.

Thanks!

Hanjun

Acked-by on the v2 series
#7 lore raw
In reply to Zenghui Yu
Quoted 4 lines · Zenghui Yu

* From v1 [1]:
- As pointed out by Hanjun, remove two now unused inline functions. Compile tested with CONFIG_IOMMU_API is not selected.

Quoted 8 lines

[1] https://lore.kernel.org/r/[email protected]

Zenghui Yu (2):
ACPI/IORT: Drop the unused @ops of iort_add_device_replay() ACPI/IORT: Remove the unused inline functions

 drivers/acpi/arm64/iort.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

On the series:

maintainer Applied
#8 lore raw
In reply to Zenghui Yu
Quoted 11 lines · Zenghui Yu

* From v1 [1]:
- As pointed out by Hanjun, remove two now unused inline functions. Compile tested with CONFIG_IOMMU_API is not selected.

[1] https://lore.kernel.org/r/[email protected]

Zenghui Yu (2):
ACPI/IORT: Drop the unused @ops of iort_add_device_replay() ACPI/IORT: Remove the unused inline functions

[...]

Applied to arm64 (for-next/acpi), thanks!

[1/2] ACPI/IORT: Drop the unused @ops of iort_add_device_replay()

      https://git.kernel.org/arm64/c/1ab64cf81489
[2/2] ACPI/IORT: Remove the unused inline functions
      https://git.kernel.org/arm64/c/c2bea7a1a1c0

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev