lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191017182121.103569-3-zenczykowski@gmail.com>
Date:   Thu, 17 Oct 2019 11:20:51 -0700
From:   Maciej Żenczykowski <zenczykowski@...il.com>
To:     Maciej Żenczykowski <maze@...gle.com>,
        "John W . Linville" <linville@...driver.com>
Cc:     netdev@...r.kernel.org
Subject: [PATCH 03/33] fix unused parameter warning in find_option()

From: Maciej Żenczykowski <maze@...gle.com>

This fixes:
  external/ethtool/ethtool.c:5417:28: error: unused parameter 'argc' [-Werror,-Wunused-parameter]
  static int find_option(int argc, char **argp)

Signed-off-by: Maciej Żenczykowski <maze@...gle.com>
Change-Id: I7782cac5f58e217fc6032037a2f248b03573b9d4
---
 ethtool.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/ethtool.c b/ethtool.c
index 5e0deda..0f3fe7f 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -5507,7 +5507,7 @@ static int show_usage(struct cmd_context *ctx maybe_unused)
 	return 0;
 }
 
-static int find_option(int argc, char **argp)
+static int find_option(char *arg)
 {
 	const char *opt;
 	size_t len;
@@ -5517,8 +5517,7 @@ static int find_option(int argc, char **argp)
 		opt = args[k].opts;
 		for (;;) {
 			len = strcspn(opt, "|");
-			if (strncmp(*argp, opt, len) == 0 &&
-			    (*argp)[len] == 0)
+			if (strncmp(arg, opt, len) == 0 && arg[len] == 0)
 				return k;
 
 			if (opt[len] == 0)
@@ -5667,7 +5666,7 @@ static int do_perqueue(struct cmd_context *ctx)
 		ctx->argp++;
 	}
 
-	i = find_option(ctx->argc, ctx->argp);
+	i = find_option(ctx->argp[0]);
 	if (i < 0)
 		exit_bad_args();
 
@@ -5719,7 +5718,7 @@ int main(int argc, char **argp)
 	if (argc == 0)
 		exit_bad_args();
 
-	k = find_option(argc, argp);
+	k = find_option(*argp);
 	if (k >= 0) {
 		argp++;
 		argc--;
-- 
2.23.0.866.gb869b98d4c-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ