Skip to contentSkip to conversation

PCI: pcie-rcar: Mark rcar_pcie_resume() with __maybe_unused

PATCH In review [email protected] 4 participants 5 messages Apr 26, 2020 – Apr 28, 2020

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

PATCH 1/1 PCI: pcie-rcar: Mark rcar_pcie_resume() with __maybe_unused

From: Marek Vasut <[email protected]>

If CONFIG_PM_SLEEP is not set, SET_SYSTEM_SLEEP_PM_OPS() is expanded to empty macro and there is no reference to rcar_pcie_resume(), hence the following warning is generated:

drivers/pci/controller/pcie-rcar.c:1253:12: warning: ‘rcar_pcie_resume’ defined but not used [-Wunused-function]
1253 | static int rcar_pcie_resume(struct device *dev)

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

Fix this by marking this function as __maybe_unused , just like in commit 226e6b866d74 ("gpio: pch: Convert to dev_pm_ops")

Cc Bjorn Helgaas <[email protected]>
Cc Lorenzo Pieralisi <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Wolfram Sang <[email protected]>

---
NOTE: Based on git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git
branch pci/rcar
NOTE: The driver tag is now 'pcie-rcar' to distinguish it from pci-rcar-gen2.c

---
 drivers/pci/controller/pcie-rcar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/pcie-rcar.c +1 -1
index b58dfe415cb3..1a0e74cad9bb 100644
@@ -1250,7 +1250,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int rcar_pcie_resume(struct device *dev)
+static int __maybe_unused rcar_pcie_resume(struct device *dev)
 {
 	struct rcar_pcie *pcie = dev_get_drvdata(dev);
 	int (*hw_init_fn)(struct rcar_pcie *);
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Sun, Apr 26, 2020 at 2:31 PM <[email protected]> wrote:

From: Marek Vasut <[email protected]>

If CONFIG_PM_SLEEP is not set, SET_SYSTEM_SLEEP_PM_OPS() is expanded to empty macro and there is no reference to rcar_pcie_resume(), hence the following warning is generated:

drivers/pci/controller/pcie-rcar.c:1253:12: warning: ‘rcar_pcie_resume’ defined but not used [-Wunused-function]
1253 | static int rcar_pcie_resume(struct device *dev)

Quoted 7 lines
      |            ^~~~~~~~~~~~~~~~

Fix this by marking this function as __maybe_unused , just like in commit 226e6b866d74 ("gpio: pch: Convert to dev_pm_ops")

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#2 lore raw
In reply to [email protected]
Quoted 20 lines · On Sun, Apr 26, 2020 at 02:31:15PM +0200, [email protected] wrote:

From: Marek Vasut <[email protected]>

If CONFIG_PM_SLEEP is not set, SET_SYSTEM_SLEEP_PM_OPS() is expanded to empty macro and there is no reference to rcar_pcie_resume(), hence the following warning is generated:

drivers/pci/controller/pcie-rcar.c:1253:12: warning: ‘rcar_pcie_resume’ defined but not used [-Wunused-function]
1253 | static int rcar_pcie_resume(struct device *dev)

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

Fix this by marking this function as __maybe_unused , just like in commit 226e6b866d74 ("gpio: pch: Convert to dev_pm_ops")

Cc Bjorn Helgaas <[email protected]>
Cc Lorenzo Pieralisi <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Wolfram Sang <[email protected]>
Quoted 4 lines

---
NOTE: Based on git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git
branch pci/rcar
NOTE: The driver tag is now 'pcie-rcar' to distinguish it from pci-rcar-gen2.c

I hope Lorenzo will squash this into the original commit. I don't think it adds anything useful to keep it as a separate commit.

Quoted 20 lines
---
 drivers/pci/controller/pcie-rcar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/pcie-rcar.c +1 -1
index b58dfe415cb3..1a0e74cad9bb 100644
@@ -1250,7 +1250,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int rcar_pcie_resume(struct device *dev)
+static int __maybe_unused rcar_pcie_resume(struct device *dev)
 {
 	struct rcar_pcie *pcie = dev_get_drvdata(dev);
 	int (*hw_init_fn)(struct rcar_pcie *);
Signature · 1 line
2.25.1
#3 lore raw
Quoted 26 lines · Bjorn Helgaas
Quoted 20 lines · On Sun, Apr 26, 2020 at 02:31:15PM +0200, [email protected] wrote:

From: Marek Vasut <[email protected]>

If CONFIG_PM_SLEEP is not set, SET_SYSTEM_SLEEP_PM_OPS() is expanded to empty macro and there is no reference to rcar_pcie_resume(), hence the following warning is generated:

drivers/pci/controller/pcie-rcar.c:1253:12: warning: ‘rcar_pcie_resume’ defined but not used [-Wunused-function]
1253 | static int rcar_pcie_resume(struct device *dev)

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

Fix this by marking this function as __maybe_unused , just like in commit 226e6b866d74 ("gpio: pch: Convert to dev_pm_ops")

Cc Bjorn Helgaas <[email protected]>
Cc Lorenzo Pieralisi <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Wolfram Sang <[email protected]>
Quoted 4 lines

---
NOTE: Based on git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git
branch pci/rcar
NOTE: The driver tag is now 'pcie-rcar' to distinguish it from pci-rcar-gen2.c

Quoted 2 lines

I hope Lorenzo will squash this into the original commit. I don't think it adds anything useful to keep it as a separate commit.

Fine by me, that's also why I added these notes, so it's obvious it's based off the same branch where the previous patch is already.

#4 lore raw
In reply to [email protected]
Quoted 20 lines · On Sun, Apr 26, 2020 at 02:31:15PM +0200, [email protected] wrote:

From: Marek Vasut <[email protected]>

If CONFIG_PM_SLEEP is not set, SET_SYSTEM_SLEEP_PM_OPS() is expanded to empty macro and there is no reference to rcar_pcie_resume(), hence the following warning is generated:

drivers/pci/controller/pcie-rcar.c:1253:12: warning: ‘rcar_pcie_resume’ defined but not used [-Wunused-function]
1253 | static int rcar_pcie_resume(struct device *dev)

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

Fix this by marking this function as __maybe_unused , just like in commit 226e6b866d74 ("gpio: pch: Convert to dev_pm_ops")

Cc Bjorn Helgaas <[email protected]>
Cc Lorenzo Pieralisi <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Wolfram Sang <[email protected]>
Quoted 7 lines

---
NOTE: Based on git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git
branch pci/rcar
NOTE: The driver tag is now 'pcie-rcar' to distinguish it from pci-rcar-gen2.c

---
 drivers/pci/controller/pcie-rcar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Squashed in https://patchwork.kernel.org/patch/11438665/

Quoted 16 lines
drivers/pci/controller/pcie-rcar.c +1 -1
index b58dfe415cb3..1a0e74cad9bb 100644
@@ -1250,7 +1250,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int rcar_pcie_resume(struct device *dev)
+static int __maybe_unused rcar_pcie_resume(struct device *dev)
 {
 	struct rcar_pcie *pcie = dev_get_drvdata(dev);
 	int (*hw_init_fn)(struct rcar_pcie *);
Signature · 1 line
2.25.1