linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: xgene: Remove unused assignment to variable msi_val
@ 2020-09-22  3:02 Krzysztof Wilczyński
  2020-09-22 14:52 ` Bjorn Helgaas
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Krzysztof Wilczyński @ 2020-09-22  3:02 UTC (permalink / raw)
  To: Toan Le
  Cc: Rob Herring, Lorenzo Pieralisi, linux-pci, Duc Dang,
	Bjorn Helgaas, linux-arm-kernel

The value assigned to msi_val after the inner loop finishes its run is
never used for anything, and it is also immediately overridden in the
line that follows with the return value from the xgene_msi_int_read()
function.

Since the value of msi_val following the inner loop completion is never
used in any meaningful way the assignment can be removed.

Addresses-Coverity-ID: 1437183 ("Unused value")
Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
---
 drivers/pci/controller/pci-xgene-msi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/pci-xgene-msi.c b/drivers/pci/controller/pci-xgene-msi.c
index 02271c6d17a1..2470782cb01a 100644
--- a/drivers/pci/controller/pci-xgene-msi.c
+++ b/drivers/pci/controller/pci-xgene-msi.c
@@ -493,8 +493,8 @@ static int xgene_msi_probe(struct platform_device *pdev)
 	 */
 	for (irq_index = 0; irq_index < NR_HW_IRQS; irq_index++) {
 		for (msi_idx = 0; msi_idx < IDX_PER_GROUP; msi_idx++)
-			msi_val = xgene_msi_ir_read(xgene_msi, irq_index,
-						    msi_idx);
+			xgene_msi_ir_read(xgene_msi, irq_index, msi_idx);
+
 		/* Read MSIINTn to confirm */
 		msi_val = xgene_msi_int_read(xgene_msi, irq_index);
 		if (msi_val) {
-- 
2.28.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] PCI: xgene: Remove unused assignment to variable msi_val
  2020-09-22  3:02 [PATCH] PCI: xgene: Remove unused assignment to variable msi_val Krzysztof Wilczyński
@ 2020-09-22 14:52 ` Bjorn Helgaas
  2020-10-01 14:42 ` Rob Herring
  2020-10-02 12:00 ` Lorenzo Pieralisi
  2 siblings, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2020-09-22 14:52 UTC (permalink / raw)
  To: Krzysztof Wilczyński
  Cc: Rob Herring, Lorenzo Pieralisi, linux-pci, Duc Dang,
	Bjorn Helgaas, Toan Le, linux-arm-kernel

On Tue, Sep 22, 2020 at 03:02:57AM +0000, Krzysztof Wilczyński wrote:
> The value assigned to msi_val after the inner loop finishes its run is
> never used for anything, and it is also immediately overridden in the
> line that follows with the return value from the xgene_msi_int_read()
> function.
> 
> Since the value of msi_val following the inner loop completion is never
> used in any meaningful way the assignment can be removed.
> 
> Addresses-Coverity-ID: 1437183 ("Unused value")
> Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
> ---
>  drivers/pci/controller/pci-xgene-msi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/controller/pci-xgene-msi.c b/drivers/pci/controller/pci-xgene-msi.c
> index 02271c6d17a1..2470782cb01a 100644
> --- a/drivers/pci/controller/pci-xgene-msi.c
> +++ b/drivers/pci/controller/pci-xgene-msi.c
> @@ -493,8 +493,8 @@ static int xgene_msi_probe(struct platform_device *pdev)
>  	 */
>  	for (irq_index = 0; irq_index < NR_HW_IRQS; irq_index++) {
>  		for (msi_idx = 0; msi_idx < IDX_PER_GROUP; msi_idx++)
> -			msi_val = xgene_msi_ir_read(xgene_msi, irq_index,
> -						    msi_idx);
> +			xgene_msi_ir_read(xgene_msi, irq_index, msi_idx);
> +

Interesting.  One might expect that throwing away the result of a read
means the read itself is pointless, but fortunately there's a comment
just above explaining that these registers are read-to-clear.

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

Assuming Toan acks this, Lorenzo will likely pick it up when he
returns next week.

>  		/* Read MSIINTn to confirm */
>  		msi_val = xgene_msi_int_read(xgene_msi, irq_index);
>  		if (msi_val) {
> -- 
> 2.28.0
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] PCI: xgene: Remove unused assignment to variable msi_val
  2020-09-22  3:02 [PATCH] PCI: xgene: Remove unused assignment to variable msi_val Krzysztof Wilczyński
  2020-09-22 14:52 ` Bjorn Helgaas
@ 2020-10-01 14:42 ` Rob Herring
  2020-10-02 12:00 ` Lorenzo Pieralisi
  2 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2020-10-01 14:42 UTC (permalink / raw)
  To: Krzysztof Wilczyński
  Cc: Lorenzo Pieralisi, linux-pci, Duc Dang, Bjorn Helgaas, Toan Le,
	linux-arm-kernel

On Tue, 22 Sep 2020 03:02:57 +0000, Krzysztof Wilczyński wrote:
> The value assigned to msi_val after the inner loop finishes its run is
> never used for anything, and it is also immediately overridden in the
> line that follows with the return value from the xgene_msi_int_read()
> function.
> 
> Since the value of msi_val following the inner loop completion is never
> used in any meaningful way the assignment can be removed.
> 
> Addresses-Coverity-ID: 1437183 ("Unused value")
> Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
> ---
>  drivers/pci/controller/pci-xgene-msi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] PCI: xgene: Remove unused assignment to variable msi_val
  2020-09-22  3:02 [PATCH] PCI: xgene: Remove unused assignment to variable msi_val Krzysztof Wilczyński
  2020-09-22 14:52 ` Bjorn Helgaas
  2020-10-01 14:42 ` Rob Herring
@ 2020-10-02 12:00 ` Lorenzo Pieralisi
  2 siblings, 0 replies; 4+ messages in thread
From: Lorenzo Pieralisi @ 2020-10-02 12:00 UTC (permalink / raw)
  To: Krzysztof Wilczyński
  Cc: Rob Herring, linux-pci, Duc Dang, Bjorn Helgaas, Toan Le,
	linux-arm-kernel

On Tue, Sep 22, 2020 at 03:02:57AM +0000, Krzysztof Wilczyński wrote:
> The value assigned to msi_val after the inner loop finishes its run is
> never used for anything, and it is also immediately overridden in the
> line that follows with the return value from the xgene_msi_int_read()
> function.
> 
> Since the value of msi_val following the inner loop completion is never
> used in any meaningful way the assignment can be removed.
> 
> Addresses-Coverity-ID: 1437183 ("Unused value")
> Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
> ---
>  drivers/pci/controller/pci-xgene-msi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to pci/xgene, thanks.

Lorenzo

> diff --git a/drivers/pci/controller/pci-xgene-msi.c b/drivers/pci/controller/pci-xgene-msi.c
> index 02271c6d17a1..2470782cb01a 100644
> --- a/drivers/pci/controller/pci-xgene-msi.c
> +++ b/drivers/pci/controller/pci-xgene-msi.c
> @@ -493,8 +493,8 @@ static int xgene_msi_probe(struct platform_device *pdev)
>  	 */
>  	for (irq_index = 0; irq_index < NR_HW_IRQS; irq_index++) {
>  		for (msi_idx = 0; msi_idx < IDX_PER_GROUP; msi_idx++)
> -			msi_val = xgene_msi_ir_read(xgene_msi, irq_index,
> -						    msi_idx);
> +			xgene_msi_ir_read(xgene_msi, irq_index, msi_idx);
> +
>  		/* Read MSIINTn to confirm */
>  		msi_val = xgene_msi_int_read(xgene_msi, irq_index);
>  		if (msi_val) {
> -- 
> 2.28.0
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-02 12:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22  3:02 [PATCH] PCI: xgene: Remove unused assignment to variable msi_val Krzysztof Wilczyński
2020-09-22 14:52 ` Bjorn Helgaas
2020-10-01 14:42 ` Rob Herring
2020-10-02 12:00 ` Lorenzo Pieralisi

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).