* [PATCH] pci: altera: remove unused 'node' variable
@ 2025-05-21 16:29 Arnd Bergmann
2025-05-22 1:48 ` Hans Zhang
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Arnd Bergmann @ 2025-05-21 16:29 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Arnd Bergmann, Joyce Ooi, Bjorn Helgaas, Jiri Slaby (SUSE),
linux-pci, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
This variable is only used when CONFIG_OF is enabled:
drivers/pci/controller/pcie-altera.c: In function 'altera_pcie_init_irq_domain':
drivers/pci/controller/pcie-altera.c:855:29: error: unused variable 'node' [-Werror=unused-variable]
855 | struct device_node *node = dev->of_node;
Use dev_fwnode() in place of of_node_to_fwnode() to avoid this.
Fixes: bbc94e6f72f2 ("PCI: Switch to irq_domain_create_linear()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
----
I checked the other PCI host bridge drivers as well, this is the
only one with that problem.
---
drivers/pci/controller/pcie-altera.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c
index 0fc77176a52e..3dbb7adc421c 100644
--- a/drivers/pci/controller/pcie-altera.c
+++ b/drivers/pci/controller/pcie-altera.c
@@ -852,10 +852,9 @@ static void aglx_isr(struct irq_desc *desc)
static int altera_pcie_init_irq_domain(struct altera_pcie *pcie)
{
struct device *dev = &pcie->pdev->dev;
- struct device_node *node = dev->of_node;
/* Setup INTx */
- pcie->irq_domain = irq_domain_create_linear(of_fwnode_handle(node), PCI_NUM_INTX,
+ pcie->irq_domain = irq_domain_create_linear(dev_fwnode(dev), PCI_NUM_INTX,
&intx_domain_ops, pcie);
if (!pcie->irq_domain) {
dev_err(dev, "Failed to get a INTx IRQ domain\n");
--
2.39.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] pci: altera: remove unused 'node' variable
2025-05-21 16:29 [PATCH] pci: altera: remove unused 'node' variable Arnd Bergmann
@ 2025-05-22 1:48 ` Hans Zhang
2025-05-22 5:53 ` Jiri Slaby
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Hans Zhang @ 2025-05-22 1:48 UTC (permalink / raw)
To: Arnd Bergmann, Thomas Gleixner
Cc: Arnd Bergmann, Joyce Ooi, Bjorn Helgaas, Jiri Slaby (SUSE),
linux-pci, linux-kernel
On 2025/5/22 00:29, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> This variable is only used when CONFIG_OF is enabled:
>
> drivers/pci/controller/pcie-altera.c: In function 'altera_pcie_init_irq_domain':
> drivers/pci/controller/pcie-altera.c:855:29: error: unused variable 'node' [-Werror=unused-variable]
> 855 | struct device_node *node = dev->of_node;
>
> Use dev_fwnode() in place of of_node_to_fwnode() to avoid this.
>
> Fixes: bbc94e6f72f2 ("PCI: Switch to irq_domain_create_linear()")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ----
> I checked the other PCI host bridge drivers as well, this is the
> only one with that problem.
> ---
> drivers/pci/controller/pcie-altera.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c
> index 0fc77176a52e..3dbb7adc421c 100644
> --- a/drivers/pci/controller/pcie-altera.c
> +++ b/drivers/pci/controller/pcie-altera.c
> @@ -852,10 +852,9 @@ static void aglx_isr(struct irq_desc *desc)
> static int altera_pcie_init_irq_domain(struct altera_pcie *pcie)
> {
> struct device *dev = &pcie->pdev->dev;
> - struct device_node *node = dev->of_node;
>
> /* Setup INTx */
> - pcie->irq_domain = irq_domain_create_linear(of_fwnode_handle(node), PCI_NUM_INTX,
> + pcie->irq_domain = irq_domain_create_linear(dev_fwnode(dev), PCI_NUM_INTX,
> &intx_domain_ops, pcie);
Hello,
Please align the code by the way.
pcie->irq_domain = irq_domain_create_linear(dev_fwnode(dev), PCI_NUM_INTX,
&intx_domain_ops, pcie);
Besides, I didn't see this commit in the linux master branch and the PCI
next branch. It should be in some branch of Thomas Gleixner, right?
Fixes: bbc94e6f72f2 ("PCI: Switch to irq_domain_create_linear()")
Best regards,
Hans
> if (!pcie->irq_domain) {
> dev_err(dev, "Failed to get a INTx IRQ domain\n");
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pci: altera: remove unused 'node' variable
2025-05-21 16:29 [PATCH] pci: altera: remove unused 'node' variable Arnd Bergmann
2025-05-22 1:48 ` Hans Zhang
@ 2025-05-22 5:53 ` Jiri Slaby
2025-05-22 6:32 ` Arnd Bergmann
2025-05-23 16:33 ` Bjorn Helgaas
2025-06-13 9:25 ` Manivannan Sadhasivam
3 siblings, 1 reply; 6+ messages in thread
From: Jiri Slaby @ 2025-05-22 5:53 UTC (permalink / raw)
To: Arnd Bergmann, Thomas Gleixner
Cc: Arnd Bergmann, Joyce Ooi, Bjorn Helgaas, linux-pci, linux-kernel
On 21. 05. 25, 18:29, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> This variable is only used when CONFIG_OF is enabled:
>
> drivers/pci/controller/pcie-altera.c: In function 'altera_pcie_init_irq_domain':
> drivers/pci/controller/pcie-altera.c:855:29: error: unused variable 'node' [-Werror=unused-variable]
> 855 | struct device_node *node = dev->of_node;
>
> Use dev_fwnode() in place of of_node_to_fwnode() to avoid this.
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Right, this reminds me that my dev_fwnode() patches (in my local queue
-- they were supposed to be in v3) are not only cleanup, but also fix
warnings.
I was thinking to send those after the merge window (so that I can route
through subsys maintainers and not bother Thomas, as they touch many
files [1]), but I will send them when I am back from a conf.
[1]
arch/powerpc/platforms/8xx/cpm1-ic.c
arch/powerpc/sysdev/fsl_msi.c
drivers/edac/altera_edac.c
drivers/gpio/gpio-brcmstb.c
drivers/gpio/gpio-davinci.c
drivers/gpio/gpio-em.c
drivers/gpio/gpio-grgpio.c
drivers/gpio/gpio-lpc18xx.c
drivers/gpio/gpio-mvebu.c
drivers/gpio/gpio-mxc.c
drivers/gpio/gpio-mxs.c
drivers/gpio/gpio-pxa.c
drivers/gpio/gpio-rockchip.c
drivers/gpio/gpio-sodaville.c
drivers/gpio/gpio-tb10x.c
drivers/gpio/gpio-twl4030.c
drivers/gpu/drm/msm/msm_mdss.c
drivers/gpu/ipu-v3/ipu-common.c
drivers/i2c/muxes/i2c-mux-pca954x.c
drivers/iio/adc/stm32-adc-core.c
drivers/irqchip/irq-imgpdc.c
drivers/irqchip/irq-imx-irqsteer.c
drivers/irqchip/irq-keystone.c
drivers/irqchip/irq-mvebu-pic.c
drivers/irqchip/irq-pruss-intc.c
drivers/irqchip/irq-renesas-intc-irqpin.c
drivers/irqchip/irq-renesas-irqc.c
drivers/irqchip/irq-renesas-rza1.c
drivers/irqchip/irq-renesas-rzg2l.c
drivers/irqchip/irq-renesas-rzv2h.c
drivers/irqchip/irq-stm32mp-exti.c
drivers/irqchip/irq-ti-sci-inta.c
drivers/irqchip/irq-ti-sci-intr.c
drivers/irqchip/irq-ts4800.c
drivers/mailbox/qcom-ipcc.c
drivers/memory/omap-gpmc.c
drivers/mfd/88pm860x-core.c
drivers/mfd/ab8500-core.c
drivers/mfd/fsl-imx25-tsadc.c
drivers/mfd/lp8788-irq.c
drivers/mfd/max8925-core.c
drivers/mfd/mt6358-irq.c
drivers/mfd/mt6397-irq.c
drivers/mfd/qcom-pm8xxx.c
drivers/mfd/stmfx.c
drivers/mfd/tps65217.c
drivers/mfd/tps6586x.c
drivers/mfd/twl4030-irq.c
drivers/mfd/twl6030-irq.c
drivers/mfd/wm831x-irq.c
drivers/misc/hi6421v600-irq.c
drivers/net/dsa/microchip/ksz_common.c
drivers/net/dsa/microchip/ksz_ptp.c
drivers/net/dsa/mv88e6xxx/global2.c
drivers/net/dsa/qca/ar9331.c
drivers/net/usb/lan78xx.c
drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
drivers/pci/controller/pcie-altera.c
drivers/pci/controller/pcie-mediatek-gen3.c
drivers/pinctrl/mediatek/mtk-eint.c
drivers/pinctrl/pinctrl-at91-pio4.c
drivers/pinctrl/sunxi/pinctrl-sunxi.c
drivers/soc/fsl/qe/qe_ic.c
drivers/soc/tegra/pmc.c
drivers/thermal/qcom/lmh.c
drivers/thermal/tegra/soctherm.c
> Fixes: bbc94e6f72f2 ("PCI: Switch to irq_domain_create_linear()")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ----
> I checked the other PCI host bridge drivers as well, this is the
> only one with that problem.
> ---
> drivers/pci/controller/pcie-altera.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c
> index 0fc77176a52e..3dbb7adc421c 100644
> --- a/drivers/pci/controller/pcie-altera.c
> +++ b/drivers/pci/controller/pcie-altera.c
> @@ -852,10 +852,9 @@ static void aglx_isr(struct irq_desc *desc)
> static int altera_pcie_init_irq_domain(struct altera_pcie *pcie)
> {
> struct device *dev = &pcie->pdev->dev;
> - struct device_node *node = dev->of_node;
>
> /* Setup INTx */
> - pcie->irq_domain = irq_domain_create_linear(of_fwnode_handle(node), PCI_NUM_INTX,
> + pcie->irq_domain = irq_domain_create_linear(dev_fwnode(dev), PCI_NUM_INTX,
> &intx_domain_ops, pcie);
> if (!pcie->irq_domain) {
> dev_err(dev, "Failed to get a INTx IRQ domain\n");
thanks,
--
js
suse labs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pci: altera: remove unused 'node' variable
2025-05-22 5:53 ` Jiri Slaby
@ 2025-05-22 6:32 ` Arnd Bergmann
0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2025-05-22 6:32 UTC (permalink / raw)
To: Jiri Slaby, Arnd Bergmann, Thomas Gleixner
Cc: Joyce Ooi, Bjorn Helgaas, linux-pci, linux-kernel
On Thu, May 22, 2025, at 07:53, Jiri Slaby wrote:
> On 21. 05. 25, 18:29, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> This variable is only used when CONFIG_OF is enabled:
>>
>> drivers/pci/controller/pcie-altera.c: In function 'altera_pcie_init_irq_domain':
>> drivers/pci/controller/pcie-altera.c:855:29: error: unused variable 'node' [-Werror=unused-variable]
>> 855 | struct device_node *node = dev->of_node;
>>
>> Use dev_fwnode() in place of of_node_to_fwnode() to avoid this.
>
> Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
>
> Right, this reminds me that my dev_fwnode() patches (in my local queue
> -- they were supposed to be in v3) are not only cleanup, but also fix
> warnings.
>
> I was thinking to send those after the merge window (so that I can route
> through subsys maintainers and not bother Thomas, as they touch many
> files [1]), but I will send them when I am back from a conf.
Ok. As far as I can tell, my two patches (mfd and pci) touching
four of those files are sufficient to address all the warnings
I see on x86, arm64 and arm. I came to the same conclusion about
being able to do more as cleanups but not needing them before the
merge window.
I also checked the power and mips specific files in your list
and they should be warning-free as far as I can tell.
Arnd
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pci: altera: remove unused 'node' variable
2025-05-21 16:29 [PATCH] pci: altera: remove unused 'node' variable Arnd Bergmann
2025-05-22 1:48 ` Hans Zhang
2025-05-22 5:53 ` Jiri Slaby
@ 2025-05-23 16:33 ` Bjorn Helgaas
2025-06-13 9:25 ` Manivannan Sadhasivam
3 siblings, 0 replies; 6+ messages in thread
From: Bjorn Helgaas @ 2025-05-23 16:33 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Thomas Gleixner, Arnd Bergmann, Joyce Ooi, Bjorn Helgaas,
Jiri Slaby (SUSE), linux-pci, linux-kernel
On Wed, May 21, 2025 at 06:29:48PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> This variable is only used when CONFIG_OF is enabled:
>
> drivers/pci/controller/pcie-altera.c: In function 'altera_pcie_init_irq_domain':
> drivers/pci/controller/pcie-altera.c:855:29: error: unused variable 'node' [-Werror=unused-variable]
> 855 | struct device_node *node = dev->of_node;
>
> Use dev_fwnode() in place of of_node_to_fwnode() to avoid this.
>
> Fixes: bbc94e6f72f2 ("PCI: Switch to irq_domain_create_linear()")
Deferring this until bbc94e6f72f2 is merged.
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ----
> I checked the other PCI host bridge drivers as well, this is the
> only one with that problem.
> ---
> drivers/pci/controller/pcie-altera.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c
> index 0fc77176a52e..3dbb7adc421c 100644
> --- a/drivers/pci/controller/pcie-altera.c
> +++ b/drivers/pci/controller/pcie-altera.c
> @@ -852,10 +852,9 @@ static void aglx_isr(struct irq_desc *desc)
> static int altera_pcie_init_irq_domain(struct altera_pcie *pcie)
> {
> struct device *dev = &pcie->pdev->dev;
> - struct device_node *node = dev->of_node;
>
> /* Setup INTx */
> - pcie->irq_domain = irq_domain_create_linear(of_fwnode_handle(node), PCI_NUM_INTX,
> + pcie->irq_domain = irq_domain_create_linear(dev_fwnode(dev), PCI_NUM_INTX,
> &intx_domain_ops, pcie);
> if (!pcie->irq_domain) {
> dev_err(dev, "Failed to get a INTx IRQ domain\n");
> --
> 2.39.5
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pci: altera: remove unused 'node' variable
2025-05-21 16:29 [PATCH] pci: altera: remove unused 'node' variable Arnd Bergmann
` (2 preceding siblings ...)
2025-05-23 16:33 ` Bjorn Helgaas
@ 2025-06-13 9:25 ` Manivannan Sadhasivam
3 siblings, 0 replies; 6+ messages in thread
From: Manivannan Sadhasivam @ 2025-06-13 9:25 UTC (permalink / raw)
To: Thomas Gleixner, Arnd Bergmann
Cc: Manivannan Sadhasivam, Arnd Bergmann, Joyce Ooi, Bjorn Helgaas,
Jiri Slaby (SUSE), linux-pci, linux-kernel
On Wed, 21 May 2025 18:29:48 +0200, Arnd Bergmann wrote:
> This variable is only used when CONFIG_OF is enabled:
>
> drivers/pci/controller/pcie-altera.c: In function 'altera_pcie_init_irq_domain':
> drivers/pci/controller/pcie-altera.c:855:29: error: unused variable 'node' [-Werror=unused-variable]
> 855 | struct device_node *node = dev->of_node;
>
> Use dev_fwnode() in place of of_node_to_fwnode() to avoid this.
>
> [...]
Applied, thanks!
[1/1] pci: altera: remove unused 'node' variable
commit: 693594d0e5d8d236fc4172c864afdcbe6993a2bd
Best regards,
--
Manivannan Sadhasivam <mani@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-06-13 9:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-21 16:29 [PATCH] pci: altera: remove unused 'node' variable Arnd Bergmann
2025-05-22 1:48 ` Hans Zhang
2025-05-22 5:53 ` Jiri Slaby
2025-05-22 6:32 ` Arnd Bergmann
2025-05-23 16:33 ` Bjorn Helgaas
2025-06-13 9:25 ` Manivannan Sadhasivam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).