Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cxl: remove redundant increment of hwirq

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 <colin.king@canonical.com>
Acked-By: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Colin Ian King and committed by
Michael Ellerman
d3383aaa d83fb87b

+1 -1
+1 -1
drivers/misc/cxl/irq.c
··· 436 436 */ 437 437 INIT_LIST_HEAD(&ctx->irq_names); 438 438 for (r = 1; r < CXL_IRQ_RANGES; r++) { 439 - for (i = 0; i < ctx->irqs.range[r]; hwirq++, i++) { 439 + for (i = 0; i < ctx->irqs.range[r]; i++) { 440 440 irq_name = kmalloc(sizeof(struct cxl_irq_name), 441 441 GFP_KERNEL); 442 442 if (!irq_name)