diff mbox

cxl: remove redundant increment of hwirq

Message ID 1422826808-31363-1-git-send-email-colin.king@canonical.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Colin Ian King Feb. 1, 2015, 9:40 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Recent commit 80fa93fce37d3490f
("cxl: Name interrupts in /proc/interrupt") introduced a
redundant increment of hwirq which is not used or even
initialised at the point it is incremented. Detected by
cppcheck:

[drivers/misc/cxl/irq.c:439]: (error) Uninitialized
  variable: hwirq

Simple fix, remove the redundant increment.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/misc/cxl/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Ellerman Feb. 2, 2015, 1:01 a.m. UTC | #1
On Sun, 2015-02-01 at 21:40 +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Recent commit 80fa93fce37d3490f
> ("cxl: Name interrupts in /proc/interrupt") introduced a
> redundant increment of hwirq which is not used or even
> initialised at the point it is incremented. Detected by
> cppcheck:
> 
> [drivers/misc/cxl/irq.c:439]: (error) Uninitialized
>   variable: hwirq
> 
> Simple fix, remove the redundant increment.

This looks more or less the same as the previous patch you sent? The one which
has been in my next branch for 11 days?

cheers
diff mbox

Patch

diff --git a/drivers/misc/cxl/irq.c b/drivers/misc/cxl/irq.c
index c294925..68ab608 100644
--- a/drivers/misc/cxl/irq.c
+++ b/drivers/misc/cxl/irq.c
@@ -436,7 +436,7 @@  int afu_register_irqs(struct cxl_context *ctx, u32 count)
 	 */
 	INIT_LIST_HEAD(&ctx->irq_names);
 	for (r = 1; r < CXL_IRQ_RANGES; r++) {
-		for (i = 0; i < ctx->irqs.range[r]; hwirq++, i++) {
+		for (i = 0; i < ctx->irqs.range[r]; i++) {
 			irq_name = kmalloc(sizeof(struct cxl_irq_name),
 					   GFP_KERNEL);
 			if (!irq_name)