linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cxl: remove redundant increment of hwirq
@ 2015-01-08 22:36 Colin King
  2015-01-08 22:42 ` Michael Neuling
  2015-01-09  2:20 ` Ian Munsie
  0 siblings, 2 replies; 5+ messages in thread
From: Colin King @ 2015-01-08 22:36 UTC (permalink / raw)
  To: Ian Munsie, Michael Neuling, linuxppc-dev; +Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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

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

* Re: [PATCH] cxl: remove redundant increment of hwirq
  2015-01-08 22:36 [PATCH] cxl: remove redundant increment of hwirq Colin King
@ 2015-01-08 22:42 ` Michael Neuling
  2015-01-09  2:20 ` Ian Munsie
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Neuling @ 2015-01-08 22:42 UTC (permalink / raw)
  To: Colin King; +Cc: linuxppc-dev, Ian Munsie, linux-kernel

On Thu, 2015-01-08 at 22:36 +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>=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 <colin.king@canonical.com>

Thanks.  Looks good.

Acked-By: Michael Neuling <mikey@neuling.org>

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

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

* Re: [PATCH] cxl: remove redundant increment of hwirq
  2015-01-08 22:36 [PATCH] cxl: remove redundant increment of hwirq Colin King
  2015-01-08 22:42 ` Michael Neuling
@ 2015-01-09  2:20 ` Ian Munsie
  1 sibling, 0 replies; 5+ messages in thread
From: Ian Munsie @ 2015-01-09  2:20 UTC (permalink / raw)
  To: Colin King; +Cc: Michael Neuling, linuxppc-dev, linux-kernel

Acked-By: Ian Munsie <imunsie@au1.ibm.com>

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

* [PATCH] cxl: remove redundant increment of hwirq
@ 2015-02-01 21:40 Colin King
  2015-02-02  1:01 ` Michael Ellerman
  0 siblings, 1 reply; 5+ messages in thread
From: Colin King @ 2015-02-01 21:40 UTC (permalink / raw)
  To: Ian Munsie, Michael Neuling, linuxppc-dev; +Cc: linux-kernel

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

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

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

* Re: [PATCH] cxl: remove redundant increment of hwirq
  2015-02-01 21:40 Colin King
@ 2015-02-02  1:01 ` Michael Ellerman
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2015-02-02  1:01 UTC (permalink / raw)
  To: Colin King; +Cc: Michael Neuling, linuxppc-dev, Ian Munsie, linux-kernel

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

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

end of thread, other threads:[~2015-02-02  1:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-08 22:36 [PATCH] cxl: remove redundant increment of hwirq Colin King
2015-01-08 22:42 ` Michael Neuling
2015-01-09  2:20 ` Ian Munsie
  -- strict thread matches above, loose matches on Subject: below --
2015-02-01 21:40 Colin King
2015-02-02  1:01 ` Michael Ellerman

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