IOMMU Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] iommu/amd: Fix sparse warnings
@ 2019-09-07  6:58 Adam Zerella
  2019-09-10  8:17 ` Joerg Roedel
  2019-09-10  9:11 ` Joerg Roedel
  0 siblings, 2 replies; 3+ messages in thread
From: Adam Zerella @ 2019-09-07  6:58 UTC (permalink / raw)
  Cc: adam.zerella, iommu, linux-kernel

There was some simple Sparse warnings related to making some
signatures static.

Signed-off-by: Adam Zerella <adam.zerella@gmail.com>
---
 drivers/iommu/amd_iommu.c      |  4 ++--
 drivers/iommu/amd_iommu_init.c | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index b607a92791d3..a9e40001720a 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -84,7 +84,7 @@ LIST_HEAD(acpihid_map);
  * Domain for untranslated devices - only allocated
  * if iommu=pt passed on kernel cmd line.
  */
-const struct iommu_ops amd_iommu_ops;
+static const struct iommu_ops amd_iommu_ops;
 
 static ATOMIC_NOTIFIER_HEAD(ppr_notifier);
 int amd_iommu_max_glx_val = -1;
@@ -3201,7 +3201,7 @@ static void amd_iommu_iotlb_range_add(struct iommu_domain *domain,
 {
 }
 
-const struct iommu_ops amd_iommu_ops = {
+static const struct iommu_ops amd_iommu_ops = {
 	.capable = amd_iommu_capable,
 	.domain_alloc = amd_iommu_domain_alloc,
 	.domain_free  = amd_iommu_domain_free,
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 4413aa67000e..f32627cadfd7 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -3050,7 +3050,7 @@ bool amd_iommu_v2_supported(void)
 }
 EXPORT_SYMBOL(amd_iommu_v2_supported);
 
-struct amd_iommu *get_amd_iommu(unsigned int idx)
+static struct amd_iommu *get_amd_iommu(unsigned int idx)
 {
 	unsigned int i = 0;
 	struct amd_iommu *iommu;
@@ -3069,7 +3069,7 @@ EXPORT_SYMBOL(get_amd_iommu);
  *
  ****************************************************************************/
 
-u8 amd_iommu_pc_get_max_banks(unsigned int idx)
+static u8 amd_iommu_pc_get_max_banks(unsigned int idx)
 {
 	struct amd_iommu *iommu = get_amd_iommu(idx);
 
@@ -3080,13 +3080,13 @@ u8 amd_iommu_pc_get_max_banks(unsigned int idx)
 }
 EXPORT_SYMBOL(amd_iommu_pc_get_max_banks);
 
-bool amd_iommu_pc_supported(void)
+static bool amd_iommu_pc_supported(void)
 {
 	return amd_iommu_pc_present;
 }
 EXPORT_SYMBOL(amd_iommu_pc_supported);
 
-u8 amd_iommu_pc_get_max_counters(unsigned int idx)
+static u8 amd_iommu_pc_get_max_counters(unsigned int idx)
 {
 	struct amd_iommu *iommu = get_amd_iommu(idx);
 
@@ -3135,7 +3135,7 @@ static int iommu_pc_get_set_reg(struct amd_iommu *iommu, u8 bank, u8 cntr,
 	return 0;
 }
 
-int amd_iommu_pc_get_reg(struct amd_iommu *iommu, u8 bank, u8 cntr, u8 fxn, u64 *value)
+static int amd_iommu_pc_get_reg(struct amd_iommu *iommu, u8 bank, u8 cntr, u8 fxn, u64 *value)
 {
 	if (!iommu)
 		return -EINVAL;
@@ -3144,7 +3144,7 @@ int amd_iommu_pc_get_reg(struct amd_iommu *iommu, u8 bank, u8 cntr, u8 fxn, u64
 }
 EXPORT_SYMBOL(amd_iommu_pc_get_reg);
 
-int amd_iommu_pc_set_reg(struct amd_iommu *iommu, u8 bank, u8 cntr, u8 fxn, u64 *value)
+static int amd_iommu_pc_set_reg(struct amd_iommu *iommu, u8 bank, u8 cntr, u8 fxn, u64 *value)
 {
 	if (!iommu)
 		return -EINVAL;
-- 
2.21.0

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iommu/amd: Fix sparse warnings
  2019-09-07  6:58 [PATCH] iommu/amd: Fix sparse warnings Adam Zerella
@ 2019-09-10  8:17 ` Joerg Roedel
  2019-09-10  9:11 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2019-09-10  8:17 UTC (permalink / raw)
  To: Adam Zerella; +Cc: iommu, linux-kernel

On Sat, Sep 07, 2019 at 04:58:12PM +1000, Adam Zerella wrote:
>  drivers/iommu/amd_iommu.c      |  4 ++--
>  drivers/iommu/amd_iommu_init.c | 12 ++++++------
>  2 files changed, 8 insertions(+), 8 deletions(-)

Applied, thanks.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iommu/amd: Fix sparse warnings
  2019-09-07  6:58 [PATCH] iommu/amd: Fix sparse warnings Adam Zerella
  2019-09-10  8:17 ` Joerg Roedel
@ 2019-09-10  9:11 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2019-09-10  9:11 UTC (permalink / raw)
  To: Adam Zerella; +Cc: iommu, linux-kernel

On Sat, Sep 07, 2019 at 04:58:12PM +1000, Adam Zerella wrote:
> There was some simple Sparse warnings related to making some
> signatures static.

And unapplied both of your patches as they causes build failures:

arch/x86/events/amd/iommu.o: In function `perf_iommu_read':
iommu.c:(.text+0xba): undefined reference to `amd_iommu_pc_get_reg'
arch/x86/events/amd/iommu.o: In function `perf_iommu_start':
iommu.c:(.text+0x2df): undefined reference to `amd_iommu_pc_set_reg'
iommu.c:(.text+0x324): undefined reference to `amd_iommu_pc_set_reg'
iommu.c:(.text+0x36b): undefined reference to `amd_iommu_pc_set_reg'
iommu.c:(.text+0x3b0): undefined reference to `amd_iommu_pc_set_reg'
iommu.c:(.text+0x424): undefined reference to `amd_iommu_pc_set_reg'
arch/x86/events/amd/iommu.o:iommu.c:(.text+0x4e4): more undefined references to `amd_iommu_pc_set_reg' follow
arch/x86/events/amd/iommu.o: In function `amd_iommu_pc_init':
iommu.c:(.init.text+0xc): undefined reference to `amd_iommu_pc_supported'
iommu.c:(.init.text+0x131): undefined reference to `get_amd_iommu'
iommu.c:(.init.text+0x140): undefined reference to `amd_iommu_pc_get_max_banks'
iommu.c:(.init.text+0x14f): undefined reference to `amd_iommu_pc_get_max_counters'
drivers/char/agp/intel-gtt.o: In function `intel_gmch_probe':
intel-gtt.c:(.text+0x135d): undefined reference to `intel_iommu_gfx_mapped'
drivers/iommu/amd_iommu_init.o: In function `state_next':
amd_iommu_init.c:(.init.text+0x1ace): undefined reference to `amd_iommu_ops'
drivers/iommu/dmar.o: In function `dmar_parse_one_drhd':
dmar.c:(.text+0x125c): undefined reference to `intel_iommu_ops'
drivers/gpu/drm/i915/intel_device_info.o: In function `intel_device_info_runtime_init':
intel_device_info.c:(.text+0xd89): undefined reference to `intel_iommu_gfx_mapped'
drivers/gpu/drm/i915/gem/i915_gem_stolen.o: In function `i915_gem_init_stolen':
i915_gem_stolen.c:(.text+0x33a): undefined reference to `intel_iommu_gfx_mapped'
drivers/gpu/drm/i915/i915_gem_gtt.o: In function `i915_ggtt_probe_hw':
i915_gem_gtt.c:(.text+0x4f61): undefined reference to `intel_iommu_gfx_mapped'
i915_gem_gtt.c:(.text+0x5127): undefined reference to `intel_iommu_gfx_mapped'
i915_gem_gtt.c:(.text+0x52d1): undefined reference to `intel_iommu_gfx_mapped'
drivers/gpu/drm/i915/i915_gem_gtt.o:i915_gem_gtt.c:(.text+0x53b3): more undefined references to `intel_iommu_gfx_mapped' follow

Please compile-test your patches next time.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-07  6:58 [PATCH] iommu/amd: Fix sparse warnings Adam Zerella
2019-09-10  8:17 ` Joerg Roedel
2019-09-10  9:11 ` Joerg Roedel

IOMMU Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iommu/0 linux-iommu/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iommu linux-iommu/ https://lore.kernel.org/linux-iommu \
		iommu@lists.linux-foundation.org iommu@archiver.kernel.org
	public-inbox-index linux-iommu


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linux-foundation.lists.iommu


AGPL code for this site: git clone https://public-inbox.org/ public-inbox