Skip to contentSkip to conversation

iommu/vt-d: Move intel_iommu_gfx_mapped to Intel IOMMU header

PATCH Applied Andy Shevchenko 3 participants 3 messages Aug 28, 2020 – Sep 4, 2020 DRM drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/vt-d: Move intel_iommu_gfx_mapped to Intel IOMMU header

Static analyzer is not happy about intel_iommu_gfx_mapped declaration:

.../drivers/iommu/intel/iommu.c:364:5: warning: symbol 'intel_iommu_gfx_mapped' was not declared. Should it be static?

Move its declaration to Intel IOMMU header file.

---
 include/drm/intel-gtt.h     | 5 +----
 include/linux/intel-iommu.h | 1 +
 2 files changed, 2 insertions(+), 4 deletions(-)
include/drm/intel-gtt.h +1 -4
index 71d81923e6b0..abfefaaf897a 100644
@@ -5,6 +5,7 @@
 #define	_DRM_INTEL_GTT_H
 
 #include <linux/agp_backend.h>
+#include <linux/intel-iommu.h>
 #include <linux/kernel.h>
 
 void intel_gtt_get(u64 *gtt_total,
@@ -33,8 +34,4 @@ void intel_gtt_clear_range(unsigned int first_entry, unsigned int num_entries);
 /* flag for GFDT type */
 #define AGP_USER_CACHED_MEMORY_GFDT (1 << 3)
 
-#ifdef CONFIG_INTEL_IOMMU
-extern int intel_iommu_gfx_mapped;
-#endif
-
 #endif
include/linux/intel-iommu.h +1 -0
index 64fa5c56c825..fbd3bb64649b 100644
@@ -794,6 +794,7 @@ extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
 extern int dmar_disabled;
 extern int intel_iommu_enabled;
 extern int intel_iommu_tboot_noforce;
+extern int intel_iommu_gfx_mapped;
 #else
 static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
 {
Signature · 6 lines
2.28.0

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

Hi Andy,

Quoted 39 lines · Andy Shevchenko

Static analyzer is not happy about intel_iommu_gfx_mapped declaration:

.../drivers/iommu/intel/iommu.c:364:5: warning: symbol 'intel_iommu_gfx_mapped' was not declared. Should it be static?

Move its declaration to Intel IOMMU header file.

---
  include/drm/intel-gtt.h     | 5 +----
  include/linux/intel-iommu.h | 1 +
  2 files changed, 2 insertions(+), 4 deletions(-)
include/drm/intel-gtt.h +1 -4
index 71d81923e6b0..abfefaaf897a 100644
@@ -5,6 +5,7 @@
  #define	_DRM_INTEL_GTT_H
 
  #include <linux/agp_backend.h>
+#include <linux/intel-iommu.h>
  #include <linux/kernel.h>
 
  void intel_gtt_get(u64 *gtt_total,
@@ -33,8 +34,4 @@ void intel_gtt_clear_range(unsigned int first_entry, unsigned int num_entries);
  /* flag for GFDT type */
  #define AGP_USER_CACHED_MEMORY_GFDT (1 << 3)
 
-#ifdef CONFIG_INTEL_IOMMU
-extern int intel_iommu_gfx_mapped;
-#endif
-
  #endif
include/linux/intel-iommu.h +0 -0
index 64fa5c56c825..fbd3bb64649b 100644

include/linux/intel-iommu.h extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu); · line 800

Quoted 7 lines
include/linux/intel-iommu.h +1 -0
@@ -794,6 +794,7 @@ extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
  extern int dmar_disabled;
  extern int intel_iommu_enabled;
  extern int intel_iommu_tboot_noforce;
+extern int intel_iommu_gfx_mapped;
  #else
  static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
  {

Looks good to me.

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

Applied
#2 lore raw
In reply to Andy Shevchenko
Quoted 11 lines · Andy Shevchenko

Static analyzer is not happy about intel_iommu_gfx_mapped declaration:

.../drivers/iommu/intel/iommu.c:364:5: warning: symbol 'intel_iommu_gfx_mapped' was not declared. Should it be static?

Move its declaration to Intel IOMMU header file.

---
 include/drm/intel-gtt.h     | 5 +----
 include/linux/intel-iommu.h | 1 +
 2 files changed, 2 insertions(+), 4 deletions(-)

Applied, thanks.

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