[PATCH] cxl: remove redundant increment of hwirq

Subsystems: char and misc drivers, the rest

STALE4225d

3 messages, 3 authors, 2015-01-09 · open the first message on its own page

[PATCH] cxl: remove redundant increment of hwirq

From: Colin King <hidden>
Date: 2015-01-08 22:37:53

From: Colin Ian King <redacted>

hwirq has not been initialized, however it is being incremented
and also not being referenced in a loop.  This error was detected with
cppcheck:

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

Commit 80fa93fce37d ("cxl: Name interrupts in /proc/interrupt") 
introduced this error.

This is a simple fix that removes the redundant increment.

Signed-off-by: Colin Ian King <redacted>
---
 drivers/misc/cxl/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
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)
-- 
2.1.4

Re: [PATCH] cxl: remove redundant increment of hwirq

From: Michael Neuling <hidden>
Date: 2015-01-08 22:42:05

On Thu, 2015-01-08 at 22:36 +0000, Colin King wrote:
From: Colin Ian King <redacted>
=20
hwirq has not been initialized, however it is being incremented
and also not being referenced in a loop.  This error was detected with
cppcheck:
=20
[drivers/misc/cxl/irq.c:439]: (error) Uninitialized variable: hwirq
=20
Commit 80fa93fce37d ("cxl: Name interrupts in /proc/interrupt")=20
introduced this error.
=20
This is a simple fix that removes the redundant increment.
=20
Signed-off-by: Colin Ian King <redacted>
Thanks.  Looks good.

Acked-By: Michael Neuling <redacted>
quoted hunk
---
 drivers/misc/cxl/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
=20
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 co=
unt)
 	 */
 	INIT_LIST_HEAD(&ctx->irq_names);
 	for (r =3D 1; r < CXL_IRQ_RANGES; r++) {
-		for (i =3D 0; i < ctx->irqs.range[r]; hwirq++, i++) {
+		for (i =3D 0; i < ctx->irqs.range[r]; i++) {
 			irq_name =3D kmalloc(sizeof(struct cxl_irq_name),
 					   GFP_KERNEL);
 			if (!irq_name)

Re: [PATCH] cxl: remove redundant increment of hwirq

From: Ian Munsie <hidden>
Date: 2015-01-09 02:20:52

Acked-By: Ian Munsie <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help