Skip to contentSkip to conversation

HIL: remove one goto

PATCH Applied Rolf Eike Beer 2 participants 2 messages Oct 31, 2012 – Nov 10, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HIL: remove one goto

This goto is only used to skip the next instruction, which can easily be done without a goto.

---
 drivers/input/serio/hil_mlc.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
drivers/input/serio/hil_mlc.c +5 -6
index bfd3865..0280167 100644
@@ -686,13 +686,12 @@ static int hilse_donode(hil_mlc *mlc)
 		write_lock_irqsave(&mlc->lock, flags);
 		pack = node->object.packet;
 	out:
-		if (mlc->istarted)
-			goto out2;
-		/* Prepare to receive input */
-		if ((node + 1)->act & HILSE_IN)
-			hilse_setup_input(mlc, node + 1);
+		if (!mlc->istarted) {
+			/* Prepare to receive input */
+			if ((node + 1)->act & HILSE_IN)
+				hilse_setup_input(mlc, node + 1);
+		}
 
-	out2:
 		write_unlock_irqrestore(&mlc->lock, flags);
 
 		if (down_trylock(&mlc->osem)) {
Signature · 1 line
1.7.7
maintainer Applied
#1 lore raw
Quoted 4 lines · Rolf Eike Beer

This goto is only used to skip the next instruction, which can easily be done without a goto.

Applied, thank you Rolf.

Signature · 1 line
Dmitry