Skip to contentSkip to conversation

iommu/virtio: Fix compile error with viommu_capable()

PATCH In review Joerg Roedel 3 participants 3 messages Sep 7, 2022

Subsystems (3)
lore
Share & tools
lore

Joerg Roedel

author maintainer
#0 lore raw

PATCH 1/1 iommu/virtio: Fix compile error with viommu_capable()

From: Joerg Roedel <[email protected]>

A recent fix introduced viommu_capable() but other changes from Robin change the function signature of the call-back it is used for.

When both changes are merged a compile error will happen because the function pointer types mismatch. Fix that by updating the viommu_capable() signature after the merge.

Cc Jean-Philippe Brucker <[email protected]>
Cc Robin Murphy <[email protected]>
---
 drivers/iommu/virtio-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/virtio-iommu.c +1 -1
index da463db9f12a..1b12825e2df1 100644
@@ -1005,7 +1005,7 @@ static int viommu_of_xlate(struct device *dev, struct of_phandle_args *args)
 	return iommu_fwspec_add_ids(dev, args->args, 1);
 }
 
-static bool viommu_capable(enum iommu_cap cap)
+static bool viommu_capable(struct device *dev, enum iommu_cap cap)
 {
 	switch (cap) {
 	case IOMMU_CAP_CACHE_COHERENCY:
Signature · 1 line
2.36.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Joerg Roedel

From: Joerg Roedel <[email protected]>

A recent fix introduced viommu_capable() but other changes from Robin change the function signature of the call-back it is used for.

Quoted 7 lines

When both changes are merged a compile error will happen because the function pointer types mismatch. Fix that by updating the viommu_capable() signature after the merge.

Cc Jean-Philippe Brucker <[email protected]>
Cc Robin Murphy <[email protected]>
Quoted 20 lines
---
 drivers/iommu/virtio-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/virtio-iommu.c +1 -1
index da463db9f12a..1b12825e2df1 100644
@@ -1005,7 +1005,7 @@ static int viommu_of_xlate(struct device *dev, struct of_phandle_args *args)
 	return iommu_fwspec_add_ids(dev, args->args, 1);
 }
 
-static bool viommu_capable(enum iommu_cap cap)
+static bool viommu_capable(struct device *dev, enum iommu_cap cap)
 {
 	switch (cap) {
 	case IOMMU_CAP_CACHE_COHERENCY:
Signature · 1 line
2.36.1
reviewer Acked-by on v1 1/1
#2 lore raw
In reply to Joerg Roedel
Quoted 9 lines · Joerg Roedel

From: Joerg Roedel <[email protected]>

A recent fix introduced viommu_capable() but other changes from Robin change the function signature of the call-back it is used for.

When both changes are merged a compile error will happen because the function pointer types mismatch. Fix that by updating the viommu_capable() signature after the merge.

I thought I'd called out somewhere that this was going to be a conflict, but apparently not, sorry about that.

Lemme spin a patch for the outstanding LKP warning on the bus series before that gets annoying too...

Quoted 20 lines
Cc Jean-Philippe Brucker <[email protected]>
Cc Robin Murphy <[email protected]>
---
  drivers/iommu/virtio-iommu.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/virtio-iommu.c +1 -1
index da463db9f12a..1b12825e2df1 100644
@@ -1005,7 +1005,7 @@ static int viommu_of_xlate(struct device *dev, struct of_phandle_args *args)
  	return iommu_fwspec_add_ids(dev, args->args, 1);
  }
 
-static bool viommu_capable(enum iommu_cap cap)
+static bool viommu_capable(struct device *dev, enum iommu_cap cap)
  {
  	switch (cap) {
  	case IOMMU_CAP_CACHE_COHERENCY: