From patchwork Fri Aug 13 17:19:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 496942 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE48DC432BE for ; Fri, 13 Aug 2021 17:19:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E2C360FC3 for ; Fri, 13 Aug 2021 17:19:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231182AbhHMRUN (ORCPT ); Fri, 13 Aug 2021 13:20:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:36982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229909AbhHMRUM (ORCPT ); Fri, 13 Aug 2021 13:20:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D798760F51; Fri, 13 Aug 2021 17:19:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628875185; bh=Th7mLcEdgD9MZb91A/vTDuBPjRrjvhIZqBlMQc2naVg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IxLfDI3kHCArf+F17HsythtMwhXtIhD5PXZn4BGoWcMLVm8chNs9MEd/TliZthI6q lVDmYpRh+RfRRNCgDxLTwXchg/+LtX3JCkZQ8K8eBhlRtJr/LpacJjA3jt7wUtYsmL hrOPAq0yKszrQ+Q7HD/E4+uxO1q9ex2ikpoHcz9Vy4n83dSugvIfJExolatY8XSV3j yhek3uUYM/gSPUmfbiOG9hwZ/bQS9GlWte8syR/oOhrGwJpXYq0jlGk4IlzQ7xavde xeOzq+gBMtQsvJ/Ei7IYH+KI1BV6pblaG39qDo7jcahJ5TKw7ZOq0KuumPQ5l9C/mZ RxqZ2CiTZkdYg== From: Jakub Kicinski To: mkubecek@suse.cz, andrew@lunn.ch Cc: netdev@vger.kernel.org, dcavalca@fb.com, filbranden@fb.com, michel@fb.com, Jakub Kicinski Subject: [PATCH ethtool 1/3] ethtool: remove questionable goto Date: Fri, 13 Aug 2021 10:19:36 -0700 Message-Id: <20210813171938.1127891-2-kuba@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210813171938.1127891-1-kuba@kernel.org> References: <20210813171938.1127891-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org goto opt_found can be trivially replaced by an else branch. Signed-off-by: Jakub Kicinski --- 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--;