Skip to contentSkip to conversation

firmware: tegra-bpmp: mark PM function as __maybe_unused

PATCH In review Arnd Bergmann 3 participants 5 messages Oct 2, 2018 – Oct 4, 2018 Tegra architecture support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firmware: tegra-bpmp: mark PM function as __maybe_unused

The newly added tegra_bpmp_resume function is unused when CONFIG_PM is disabled:

drivers/firmware/tegra/bpmp.c:847:12: error: 'tegra_bpmp_resume' defined but not used [-Werror=unused-function]
static int tegra_bpmp_resume(struct device *dev)

Mark it as __maybe_unused to avoid the warning and let the compiler drop it silently.

Fixes cd40f6ff124c ("firmware: tegra: bpmp: Implement suspend/resume support")
---
 drivers/firmware/tegra/bpmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/tegra/bpmp.c +1 -1
index 41448ba78be9..a3d5b518c10e 100644
@@ -844,7 +844,7 @@ static int tegra_bpmp_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int tegra_bpmp_resume(struct device *dev)
+static int __maybe_unused tegra_bpmp_resume(struct device *dev)
 {
 	struct tegra_bpmp *bpmp = dev_get_drvdata(dev);
 	unsigned int i;
Signature · 1 line
2.18.0
maintainer
#1 lore raw
Quoted 20 lines · Arnd Bergmann

The newly added tegra_bpmp_resume function is unused when CONFIG_PM is disabled:

drivers/firmware/tegra/bpmp.c:847:12: error: 'tegra_bpmp_resume' defined but not used [-Werror=unused-function]
static int tegra_bpmp_resume(struct device *dev)

Mark it as __maybe_unused to avoid the warning and let the compiler drop it silently.

Fixes cd40f6ff124c ("firmware: tegra: bpmp: Implement suspend/resume support")
---
 drivers/firmware/tegra/bpmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/tegra/bpmp.c +0 -0
index 41448ba78be9..a3d5b518c10e 100644

drivers/firmware/tegra/bpmp.c static int tegra_bpmp_probe(struct platform_device *pdev) · line 850

Quoted 8 lines
drivers/firmware/tegra/bpmp.c +1 -1
@@ -844,7 +844,7 @@ static int tegra_bpmp_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int tegra_bpmp_resume(struct device *dev)
+static int __maybe_unused tegra_bpmp_resume(struct device *dev)
 {
 	struct tegra_bpmp *bpmp = dev_get_drvdata(dev);
 	unsigned int i;

Arnd, is this seen with 32-bit ARM configs?

Timo, does it make sense to make BPMP dependent on ARCH_TEGRA_186_SOC and ARCH_TEGRA_194_SOC instead of just ARCH_TEGRA? For 64-bit Tegra we have a dependency on PM so this should not be seen for 64-bit Tegra.

Cheers
Jon

Signature · 1 line
nvpublic
#2 lore raw
Quoted 33 lines · Jonathan Hunter
Quoted 20 lines · Arnd Bergmann

The newly added tegra_bpmp_resume function is unused when CONFIG_PM is disabled:

drivers/firmware/tegra/bpmp.c:847:12: error: 'tegra_bpmp_resume' defined but not used [-Werror=unused-function]
static int tegra_bpmp_resume(struct device *dev)

Mark it as __maybe_unused to avoid the warning and let the compiler drop it silently.

Fixes cd40f6ff124c ("firmware: tegra: bpmp: Implement suspend/resume support")
---
  drivers/firmware/tegra/bpmp.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/tegra/bpmp.c +0 -0
index 41448ba78be9..a3d5b518c10e 100644

drivers/firmware/tegra/bpmp.c static int tegra_bpmp_probe(struct platform_device *pdev) · line 850

Quoted 8 lines
drivers/firmware/tegra/bpmp.c +1 -1
@@ -844,7 +844,7 @@ static int tegra_bpmp_probe(struct platform_device *pdev)
  	return err;
  }
 
-static int tegra_bpmp_resume(struct device *dev)
+static int __maybe_unused tegra_bpmp_resume(struct device *dev)
  {
  	struct tegra_bpmp *bpmp = dev_get_drvdata(dev);
  	unsigned int i;

Arnd, is this seen with 32-bit ARM configs?

Quoted 3 lines

Timo, does it make sense to make BPMP dependent on ARCH_TEGRA_186_SOC and ARCH_TEGRA_194_SOC instead of just ARCH_TEGRA? For 64-bit Tegra we have a dependency on PM so this should not be seen for 64-bit Tegra.

Jon, there will be eventually a BPMP driver for ARCH_TEGRA_210_SOC as well. So it is probably more appropriate to make BPMP dependent on ARM64 & ARCH_TEGRA.

-Timo

#3 lore raw
Quoted 25 lines · Timo Alho
Quoted 24 lines · Jonathan Hunter
Quoted 23 lines · Arnd Bergmann

The newly added tegra_bpmp_resume function is unused when CONFIG_PM is disabled:

drivers/firmware/tegra/bpmp.c:847:12: error: 'tegra_bpmp_resume' defined but not used [-Werror=unused-function]
static int tegra_bpmp_resume(struct device *dev)

Mark it as __maybe_unused to avoid the warning and let the compiler drop it silently.

Fixes cd40f6ff124c ("firmware: tegra: bpmp: Implement suspend/resume support")
---
  drivers/firmware/tegra/bpmp.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/tegra/bpmp.c +0 -0
index 41448ba78be9..a3d5b518c10e 100644
@@ -844,7 +844,7 @@ static int tegra_bpmp_probe(struct platform_device *pdev)
     return err;
  }
 
Quoted 7 lines
Quoted 7 lines

drivers/firmware/tegra/bpmp.c static int tegra_bpmp_probe(struct platform_device *pdev) · line 850

Quoted 5 lines
drivers/firmware/tegra/bpmp.c +1 -1
-static int tegra_bpmp_resume(struct device *dev)
+static int __maybe_unused tegra_bpmp_resume(struct device *dev)
  {
     struct tegra_bpmp *bpmp = dev_get_drvdata(dev);
     unsigned int i;

Arnd, is this seen with 32-bit ARM configs?

This was with a randconfig build on 64-bit ARM. I don't know exactly what combination of options caused it.

Quoted 3 lines
Quoted 3 lines

Timo, does it make sense to make BPMP dependent on ARCH_TEGRA_186_SOC and ARCH_TEGRA_194_SOC instead of just ARCH_TEGRA? For 64-bit Tegra we have a dependency on PM so this should not be seen for 64-bit Tegra.

CONFIG_PM does not imply CONFIG_PM_SLEEP, so probably it was just broken for PM=y, PM_SLEEP=n.

Quoted 3 lines

Jon, there will be eventually a BPMP driver for ARCH_TEGRA_210_SOC as well. So it is probably more appropriate to make BPMP dependent on ARM64 & ARCH_TEGRA.

Generally speaking, we are trying to allow building all drivers at least with CONFIG_COMPILE_TEST, in order to get the best build coverage.

Arnd

maintainer Acked-by
#4 lore raw
Quoted 37 lines · Arnd Bergmann
Quoted 25 lines · Timo Alho
Quoted 24 lines · Jonathan Hunter
Quoted 23 lines · Arnd Bergmann

The newly added tegra_bpmp_resume function is unused when CONFIG_PM is disabled:

drivers/firmware/tegra/bpmp.c:847:12: error: 'tegra_bpmp_resume' defined but not used [-Werror=unused-function]
static int tegra_bpmp_resume(struct device *dev)

Mark it as __maybe_unused to avoid the warning and let the compiler drop it silently.

Fixes cd40f6ff124c ("firmware: tegra: bpmp: Implement suspend/resume support")
---
  drivers/firmware/tegra/bpmp.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/tegra/bpmp.c +0 -0
index 41448ba78be9..a3d5b518c10e 100644
@@ -844,7 +844,7 @@ static int tegra_bpmp_probe(struct platform_device *pdev)
     return err;
  }
 
Quoted 7 lines
Quoted 7 lines

drivers/firmware/tegra/bpmp.c static int tegra_bpmp_probe(struct platform_device *pdev) · line 850

Quoted 5 lines
drivers/firmware/tegra/bpmp.c +1 -1
-static int tegra_bpmp_resume(struct device *dev)
+static int __maybe_unused tegra_bpmp_resume(struct device *dev)
  {
     struct tegra_bpmp *bpmp = dev_get_drvdata(dev);
     unsigned int i;

Arnd, is this seen with 32-bit ARM configs?

This was with a randconfig build on 64-bit ARM. I don't know exactly what combination of options caused it.

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

Timo, does it make sense to make BPMP dependent on ARCH_TEGRA_186_SOC and ARCH_TEGRA_194_SOC instead of just ARCH_TEGRA? For 64-bit Tegra we have a dependency on PM so this should not be seen for 64-bit Tegra.

CONFIG_PM does not imply CONFIG_PM_SLEEP, so probably it was just broken for PM=y, PM_SLEEP=n.

Yes that would make sense.

Quoted 6 lines
Quoted 3 lines

Jon, there will be eventually a BPMP driver for ARCH_TEGRA_210_SOC as well. So it is probably more appropriate to make BPMP dependent on ARM64 & ARCH_TEGRA.

Generally speaking, we are trying to allow building all drivers at least with CONFIG_COMPILE_TEST, in order to get the best build coverage.

True. Thinking some more it is fine with me, so ...

Cheers
Jon

Signature · 1 line
nvpublic