diff mbox series

PCI: rcar: don't shadow the 'irq' variable

Message ID 20190317093445.7746-1-wsa+renesas@sang-engineering.com (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show
Series PCI: rcar: don't shadow the 'irq' variable | expand

Commit Message

Wolfram Sang March 17, 2019, 9:34 a.m. UTC
sparse rightfully says:
drivers/pci/controller/pcie-rcar.c:741:30: warning: symbol 'irq' shadows an earlier one

It doesn't affect the current code. But fix it now to avoid future
surprises and for good coding style.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Only build tested.

 drivers/pci/controller/pcie-rcar.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Geert Uytterhoeven March 18, 2019, 10:16 a.m. UTC | #1
On Sun, Mar 17, 2019 at 10:35 AM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> sparse rightfully says:
> drivers/pci/controller/pcie-rcar.c:741:30: warning: symbol 'irq' shadows an earlier one
>
> It doesn't affect the current code. But fix it now to avoid future
> surprises and for good coding style.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
Simon Horman March 18, 2019, 10:36 a.m. UTC | #2
On Sun, Mar 17, 2019 at 10:34:45AM +0100, Wolfram Sang wrote:
> sparse rightfully says:
> drivers/pci/controller/pcie-rcar.c:741:30: warning: symbol 'irq' shadows an earlier one
> 
> It doesn't affect the current code. But fix it now to avoid future
> surprises and for good coding style.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

> ---
> 
> Only build tested.
> 
>  drivers/pci/controller/pcie-rcar.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/controller/pcie-rcar.c b/drivers/pci/controller/pcie-rcar.c
> index 7002e9ad0b81..f513058e3a70 100644
> --- a/drivers/pci/controller/pcie-rcar.c
> +++ b/drivers/pci/controller/pcie-rcar.c
> @@ -738,15 +738,15 @@ static irqreturn_t rcar_pcie_msi_irq(int irq, void *data)
>  
>  	while (reg) {
>  		unsigned int index = find_first_bit(&reg, 32);
> -		unsigned int irq;
> +		unsigned int msi_irq;
>  
>  		/* clear the interrupt */
>  		rcar_pci_write_reg(pcie, 1 << index, PCIEMSIFR);
>  
> -		irq = irq_find_mapping(msi->domain, index);
> -		if (irq) {
> +		msi_irq = irq_find_mapping(msi->domain, index);
> +		if (msi_irq) {
>  			if (test_bit(index, msi->used))
> -				generic_handle_irq(irq);
> +				generic_handle_irq(msi_irq);
>  			else
>  				dev_info(dev, "unhandled MSI\n");
>  		} else {
> -- 
> 2.19.1
>
Lorenzo Pieralisi March 29, 2019, 4:23 p.m. UTC | #3
On Sun, Mar 17, 2019 at 10:34:45AM +0100, Wolfram Sang wrote:
> sparse rightfully says:
> drivers/pci/controller/pcie-rcar.c:741:30: warning: symbol 'irq' shadows an earlier one
> 
> It doesn't affect the current code. But fix it now to avoid future
> surprises and for good coding style.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> 
> Only build tested.
> 
>  drivers/pci/controller/pcie-rcar.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied to pci/rcar for v5.2, thanks.

Lorenzo

> diff --git a/drivers/pci/controller/pcie-rcar.c b/drivers/pci/controller/pcie-rcar.c
> index 7002e9ad0b81..f513058e3a70 100644
> --- a/drivers/pci/controller/pcie-rcar.c
> +++ b/drivers/pci/controller/pcie-rcar.c
> @@ -738,15 +738,15 @@ static irqreturn_t rcar_pcie_msi_irq(int irq, void *data)
>  
>  	while (reg) {
>  		unsigned int index = find_first_bit(&reg, 32);
> -		unsigned int irq;
> +		unsigned int msi_irq;
>  
>  		/* clear the interrupt */
>  		rcar_pci_write_reg(pcie, 1 << index, PCIEMSIFR);
>  
> -		irq = irq_find_mapping(msi->domain, index);
> -		if (irq) {
> +		msi_irq = irq_find_mapping(msi->domain, index);
> +		if (msi_irq) {
>  			if (test_bit(index, msi->used))
> -				generic_handle_irq(irq);
> +				generic_handle_irq(msi_irq);
>  			else
>  				dev_info(dev, "unhandled MSI\n");
>  		} else {
> -- 
> 2.19.1
>
diff mbox series

Patch

diff --git a/drivers/pci/controller/pcie-rcar.c b/drivers/pci/controller/pcie-rcar.c
index 7002e9ad0b81..f513058e3a70 100644
--- a/drivers/pci/controller/pcie-rcar.c
+++ b/drivers/pci/controller/pcie-rcar.c
@@ -738,15 +738,15 @@  static irqreturn_t rcar_pcie_msi_irq(int irq, void *data)
 
 	while (reg) {
 		unsigned int index = find_first_bit(&reg, 32);
-		unsigned int irq;
+		unsigned int msi_irq;
 
 		/* clear the interrupt */
 		rcar_pci_write_reg(pcie, 1 << index, PCIEMSIFR);
 
-		irq = irq_find_mapping(msi->domain, index);
-		if (irq) {
+		msi_irq = irq_find_mapping(msi->domain, index);
+		if (msi_irq) {
 			if (test_bit(index, msi->used))
-				generic_handle_irq(irq);
+				generic_handle_irq(msi_irq);
 			else
 				dev_info(dev, "unhandled MSI\n");
 		} else {