diff mbox series

[ethtool,1/3] ethtool: remove questionable goto

Message ID 20210813171938.1127891-2-kuba@kernel.org
State New
Headers show
Series [ethtool,1/3] ethtool: remove questionable goto | expand

Commit Message

Jakub Kicinski Aug. 13, 2021, 5:19 p.m. UTC
goto opt_found can be trivially replaced by an else branch.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 ethtool.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/ethtool.c b/ethtool.c
index 33a0a492cb15..8cf1b13e4176 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -6352,15 +6352,14 @@  int main(int argc, char **argp)
 		nlfunc = args[k].nlfunc;
 		nlchk = args[k].nlchk;
 		no_dev = args[k].no_dev;
-		goto opt_found;
+	} else {
+		if ((*argp)[0] == '-')
+			exit_bad_args();
+		nlfunc = nl_gset;
+		func = do_gset;
+		no_dev = false;
 	}
-	if ((*argp)[0] == '-')
-		exit_bad_args();
-	nlfunc = nl_gset;
-	func = do_gset;
-	no_dev = false;
 
-opt_found:
 	if (!no_dev) {
 		ctx.devname = *argp++;
 		argc--;