Thread (2 messages) 2 messages, 2 authors, 2015-01-14

[PATCH] tools: kmod: break iteration once a command is executed

flat view
STALE4283d

From: Caio Marcelo de Oliveira Filho <hidden>
Date: 2015-01-14 14:09:27
Subsystem: the rest · Maintainer: Linus Torvalds

---
 tools/kmod.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/kmod.c b/tools/kmod.c
index abb1707..a8534cd 100644
--- a/tools/kmod.c
+++ b/tools/kmod.c
@@ -124,10 +124,10 @@ static int handle_kmod_commands(int argc, char *argv[])
 	cmd = argv[optind];
 
 	for (i = 0, err = -EINVAL; i < ARRAY_SIZE(kmod_cmds); i++) {
-		if (strcmp(kmod_cmds[i]->name, cmd) != 0)
-			continue;
-
-		err = kmod_cmds[i]->cmd(--argc, ++argv);
+		if (strcmp(kmod_cmds[i]->name, cmd) == 0) {
+			err = kmod_cmds[i]->cmd(--argc, ++argv);
+			break;
+		}
 	}
 
 	if (err < 0) {
-- 
2.2.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help