aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2019-10-17 11:20:50 -0700
committerJohn W. Linville <linville@tuxdriver.com>2019-10-29 13:51:21 -0400
commitd5432a966f13a90a0cd429d3f4d8785905be92e9 (patch)
treea15370c4db92f289a81cababfcd4909844a10e72
parentc430e7511f0d304a1365384ca617a813e1a6602b (diff)
downloadethtool-d5432a966f13a90a0cd429d3f4d8785905be92e9.tar.gz
fix unused parameter warnings in do_version() and show_usage()
This fixes: external/ethtool/ethtool.c:473:43: error: unused parameter 'ctx' [-Werror,-Wunused-parameter] static int do_version(struct cmd_context *ctx) external/ethtool/ethtool.c:5392:43: error: unused parameter 'ctx' [-Werror,-Wunused-parameter] static int show_usage(struct cmd_context *ctx) Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I0cc52f33bb0e8d7627f5e84bb4e3dfa821d17cc8 Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--ethtool.c4
-rw-r--r--internal.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/ethtool.c b/ethtool.c
index 082e37f..5e0deda 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -470,7 +470,7 @@ static int rxflow_str_to_type(const char *str)
return flow_type;
}
-static int do_version(struct cmd_context *ctx)
+static int do_version(struct cmd_context *ctx maybe_unused)
{
fprintf(stdout,
PACKAGE " version " VERSION
@@ -5484,7 +5484,7 @@ static const struct option {
{}
};
-static int show_usage(struct cmd_context *ctx)
+static int show_usage(struct cmd_context *ctx maybe_unused)
{
int i;
diff --git a/internal.h b/internal.h
index aecf1ce..ff52c6e 100644
--- a/internal.h
+++ b/internal.h
@@ -23,6 +23,8 @@
#include <sys/ioctl.h>
#include <net/if.h>
+#define maybe_unused __attribute__((__unused__))
+
/* ethtool.h expects these to be defined by <linux/types.h> */
#ifndef HAVE_BE_TYPES
typedef uint16_t __be16;