Skip to contentSkip to conversation

memory: tegra: fix unused-function warning

PATCH Applied Arnd Bergmann 3 participants 3 messages Jul 22, 2021 – Jul 23, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memory: tegra: fix unused-function warning

From: Arnd Bergmann <[email protected]>

The tegra186_mc_client_sid_override() is only called from an #ifdef block:

drivers/memory/tegra/tegra186.c:74:13: error: 'tegra186_mc_client_sid_override' defined but not used [-Werror=unused-function]
74 | static void tegra186_mc_client_sid_override(struct tegra_mc *mc,

      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Add another #ifdef around the called function.

Fixes 393d66fd2cac ("memory: tegra: Implement SID override programming")
---
 drivers/memory/tegra/tegra186.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/memory/tegra/tegra186.c +2 -0
index e65eac5764d4..3d153881abc1 100644
@@ -71,6 +71,7 @@ static int tegra186_mc_resume(struct tegra_mc *mc)
 	return 0;
 }
 
+#if IS_ENABLED(CONFIG_IOMMU_API)
 static void tegra186_mc_client_sid_override(struct tegra_mc *mc,
 					    const struct tegra_mc_client *client,
 					    unsigned int sid)
@@ -108,6 +109,7 @@ static void tegra186_mc_client_sid_override(struct tegra_mc *mc,
 		writel(sid, mc->regs + client->regs.sid.override);
 	}
 }
+#endif
 
 static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev)
 {
Signature · 1 line
2.29.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 31 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The tegra186_mc_client_sid_override() is only called from an #ifdef block:

drivers/memory/tegra/tegra186.c:74:13: error: 'tegra186_mc_client_sid_override' defined but not used [-Werror=unused-function]
74 | static void tegra186_mc_client_sid_override(struct tegra_mc *mc,

      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Add another #ifdef around the called function.

Fixes 393d66fd2cac ("memory: tegra: Implement SID override programming")
---
 drivers/memory/tegra/tegra186.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/memory/tegra/tegra186.c +1 -0
index e65eac5764d4..3d153881abc1 100644
@@ -71,6 +71,7 @@ static int tegra186_mc_resume(struct tegra_mc *mc)
 	return 0;
 }
 
+#if IS_ENABLED(CONFIG_IOMMU_API)
 static void tegra186_mc_client_sid_override(struct tegra_mc *mc,
 					    const struct tegra_mc_client *client,
 					    unsigned int sid)

drivers/memory/tegra/tegra186.c static void tegra186_mc_client_sid_override(struct tegra_mc *mc, · line 115

Quoted 7 lines
drivers/memory/tegra/tegra186.c +1 -0
@@ -108,6 +109,7 @@ static void tegra186_mc_client_sid_override(struct tegra_mc *mc,
 		writel(sid, mc->regs + client->regs.sid.override);
 	}
 }
+#endif
 
 static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev)
 {

Thanks for fixing!

Jon

Signature · 1 line
nvpublic
#2 lore raw
In reply to Arnd Bergmann
Quoted 8 lines · Arnd Bergmann

The tegra186_mc_client_sid_override() is only called from an #ifdef block:

drivers/memory/tegra/tegra186.c:74:13: error: 'tegra186_mc_client_sid_override' defined but not used [-Werror=unused-function]
74 | static void tegra186_mc_client_sid_override(struct tegra_mc *mc,

      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[...]

Applied, thanks!

[1/1] memory: tegra: fix unused-function warning

      commit: eaf89f1cd38cf7256ab64424fe94014632044d57

Best regards,

Signature · 1 line
Krzysztof Kozlowski <[email protected]>