[v1] examples/vm_power_manager: fix unreachable code

Message ID 20190410131348.25287-1-david.hunt@intel.com
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series
  • [v1] examples/vm_power_manager: fix unreachable code
Related show

Checks

Context Check Description
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

David Hunt April 10, 2019, 1:13 p.m.
A for loop to MAX_VFS had a break as the last line, so the w++
would never get called, breaking out of the loop after the
first iteration. Remove the break so that the loop can execute
properly.

Fixes: ace158c4a821 ("examples/vm_power: add check for port count")
Coverity issue: 337682

Signed-off-by: David Hunt <david.hunt@intel.com>
---
 examples/vm_power_manager/main.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Rami Rosen April 10, 2019, 11:58 p.m. | #1
David Hunt ‏<david.hunt@intel.com>:

> A for loop to MAX_VFS had a break as the last line, so the w++
> would never get called, breaking out of the loop after the
> first iteration. Remove the break so that the loop can execute
> properly.
>
> Fixes: ace158c4a821 ("examples/vm_power: add check for port count")
> Coverity issue: 337682
>
> Signed-off-by: David Hunt <david.hunt@intel.com>
> ---
>

Acked-by: Rami Rosen <ramirose@gmail.com>
Thomas Monjalon April 22, 2019, 9:05 p.m. | #2
> > A for loop to MAX_VFS had a break as the last line, so the w++
> > would never get called, breaking out of the loop after the
> > first iteration. Remove the break so that the loop can execute
> > properly.
> >
> > Fixes: ace158c4a821 ("examples/vm_power: add check for port count")
> > Coverity issue: 337682
> >
> > Signed-off-by: David Hunt <david.hunt@intel.com>
> 
> Acked-by: Rami Rosen <ramirose@gmail.com>

Applied, thanks

Patch

diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 893bf4cdd..9b11f66f9 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -390,7 +390,6 @@  main(int argc, char **argv)
 					break;
 				}
 				printf("\n");
-				break;
 			}
 		}
 	}