From: Jakub Kicinski <kuba@kernel.org>
To: mkubecek@suse.cz, andrew@lunn.ch
Cc: netdev@vger.kernel.org, dcavalca@fb.com, filbranden@fb.com,
michel@fb.com, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH ethtool 1/3] ethtool: remove questionable goto
Date: Fri, 13 Aug 2021 10:19:36 -0700 [thread overview]
Message-ID: <20210813171938.1127891-2-kuba@kernel.org> (raw)
In-Reply-To: <20210813171938.1127891-1-kuba@kernel.org>
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 --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--;
--
2.31.1
next prev parent reply other threads:[~2021-08-13 17:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 17:19 [PATCH ethtool 0/3] ethool: make --json reliable Jakub Kicinski
2021-08-13 17:19 ` Jakub Kicinski [this message]
2021-08-13 17:19 ` [PATCH ethtool 2/3] ethtool: use dummy args[] entry for no-args case Jakub Kicinski
2021-08-24 17:41 ` Michal Kubecek
2021-08-24 17:43 ` Jakub Kicinski
2021-08-24 19:46 ` Michal Kubecek
2021-08-13 17:19 ` [PATCH ethtool 3/3] ethtool: return error if command does not support --json Jakub Kicinski
2021-08-24 14:08 ` [PATCH ethtool 0/3] ethool: make --json reliable Jakub Kicinski
2021-08-24 17:30 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210813171938.1127891-2-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew@lunn.ch \
--cc=dcavalca@fb.com \
--cc=filbranden@fb.com \
--cc=michel@fb.com \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).