Skip to contentSkip to conversation

iommu/vt-d: Make function signatures static

PATCH Applied Adam Zerella 4 participants 5 messages Sep 7, 2019 – Sep 10, 2019 IOMMU

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/vt-d: Make function signatures static

warning: symbol 'intel_iommu_gfx_mapped' was not declared. Should it be static?
warning: symbol 'intel_iommu_ops' was not declared. Should it be static?

Squash a couple of Sparse warnings by making these symbols static.

---
 drivers/iommu/intel-iommu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iommu/intel-iommu.c +3 -3
index 12d094d08c0a..28134891fa9c 100644
@@ -365,7 +365,7 @@ static int iommu_identity_mapping;
 #define IDENTMAP_GFX		2
 #define IDENTMAP_AZALIA		4
 
-int intel_iommu_gfx_mapped;
+static int intel_iommu_gfx_mapped;
 EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped);
 
 #define DUMMY_DEVICE_DOMAIN_INFO ((struct device_domain_info *)(-1))
@@ -397,7 +397,7 @@ int for_each_device_domain(int (*fn)(struct device_domain_info *info,
 	return 0;
 }
 
-const struct iommu_ops intel_iommu_ops;
+static const struct iommu_ops intel_iommu_ops;
 
 static bool translation_pre_enabled(struct intel_iommu *iommu)
 {
@@ -5613,7 +5613,7 @@ static bool intel_iommu_is_attach_deferred(struct iommu_domain *domain,
 	return dev->archdata.iommu == DEFER_DEVICE_DOMAIN_INFO;
 }
 
-const struct iommu_ops intel_iommu_ops = {
+static const struct iommu_ops intel_iommu_ops = {
 	.capable		= intel_iommu_capable,
 	.domain_alloc		= intel_iommu_domain_alloc,
 	.domain_free		= intel_iommu_domain_free,
Signature · 6 lines
2.21.0

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
#1 lore raw

Hi,

Quoted 15 lines · Adam Zerella

warning: symbol 'intel_iommu_gfx_mapped' was not declared. Should it be static?
warning: symbol 'intel_iommu_ops' was not declared. Should it be static?

Squash a couple of Sparse warnings by making these symbols static.

---
  drivers/iommu/intel-iommu.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iommu/intel-iommu.c +0 -0
index 12d094d08c0a..28134891fa9c 100644

drivers/iommu/intel-iommu.c static int iommu_identity_mapping; · line 369

Quoted 6 lines
drivers/iommu/intel-iommu.c +1 -1
@@ -365,7 +365,7 @@ static int iommu_identity_mapping;
  #define IDENTMAP_GFX		2
  #define IDENTMAP_AZALIA		4
 
-int intel_iommu_gfx_mapped;
+static int intel_iommu_gfx_mapped;
  EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped);

It's hard to understand this. This symbol is exported and used in the graphic driver. How could it be static?

drivers/iommu/intel-iommu.c int for_each_device_domain(int (*fn)(struct device_domain_info *info, · line 400

Quoted 8 lines
drivers/iommu/intel-iommu.c +1 -1
  #define DUMMY_DEVICE_DOMAIN_INFO ((struct device_domain_info *)(-1))
@@ -397,7 +397,7 @@ int for_each_device_domain(int (*fn)(struct device_domain_info *info,
  	return 0;
  }
 
-const struct iommu_ops intel_iommu_ops;
+static const struct iommu_ops intel_iommu_ops;

Ditto. This is used in dmar.c.

Best regards,
Baolu

drivers/iommu/intel-iommu.c static bool intel_iommu_is_attach_deferred(struct iommu_domain *domain, · line 5619

Quoted 13 lines
drivers/iommu/intel-iommu.c +1 -1
  static bool translation_pre_enabled(struct intel_iommu *iommu)
  {
@@ -5613,7 +5613,7 @@ static bool intel_iommu_is_attach_deferred(struct iommu_domain *domain,
  	return dev->archdata.iommu == DEFER_DEVICE_DOMAIN_INFO;
  }
 
-const struct iommu_ops intel_iommu_ops = {
+static const struct iommu_ops intel_iommu_ops = {
  	.capable		= intel_iommu_capable,
  	.domain_alloc		= intel_iommu_domain_alloc,
  	.domain_free		= intel_iommu_domain_free,

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

#3 lore raw
Quoted 5 lines · Joerg Roedel
Quoted 2 lines · Adam Zerella
 drivers/iommu/intel-iommu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.

Joerg, not sure if you saw the reply from Lu,

https://lore.kernel.org/linux-iommu/[email protected]
ntel.com/

This patch is not even compiled for me as well.

WARNING: "intel_iommu_gfx_mapped" [vmlinux] is a static EXPORT_SYMBOL_GPL drivers/iommu/dmar.o: In function `iommu_device_set_ops':
/home/linux-mm/linux/./include/linux/iommu.h:382: undefined reference to `intel_iommu_ops'
make: *** [Makefile:1096: vmlinux] Error 1
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

maintainer
#4 lore raw
Quoted 11 lines · Qian Cai
Quoted 5 lines · Joerg Roedel
Quoted 2 lines · Adam Zerella
 drivers/iommu/intel-iommu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.

Joerg, not sure if you saw the reply from Lu,

https://lore.kernel.org/linux-iommu/[email protected]
ntel.com/

No, havn't seen any reply, but I figured out myself :) This patch is already unmerged.

Joerg

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu