diff mbox series

[OpenWrt-Devel,1/7] procd: simplify code in procd_inittab_run

Message ID ec10b9cace454170f8d3c6feb1f90f72c8b61981.1546385477.git.mhei@heimpold.de
State Accepted
Delegated to: John Crispin
Headers show
Series procd: console hotplugging support | expand

Commit Message

Michael Heimpold Jan. 1, 2019, 11:44 p.m. UTC
This is a trial to make it more obvious what the historically
grown code is actually doing.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
---
v2: use Jo-Philipp Wich's proposal

 inittab.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/inittab.c b/inittab.c
index 55554b9..c9e6c13 100644
--- a/inittab.c
+++ b/inittab.c
@@ -259,12 +259,9 @@  void procd_inittab_run(const char *handler)
 
 	list_for_each_entry(a, &actions, list)
 		if (!strcmp(a->handler->name, handler)) {
-			if (a->handler->multi) {
-				a->handler->cb(a);
-				continue;
-			}
 			a->handler->cb(a);
-			break;
+			if (!a->handler->multi)
+				break;
 		}
 }