aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2020-08-03 13:57:21 +0200
committerMichal Kubecek <mkubecek@suse.cz>2020-08-04 14:15:28 +0200
commit0b49ed378aa5ad23b8e6a102570cd8904d1f0b07 (patch)
treef8a11060aaccb31f68893706cfa165854844668c
parent5b115f5a7d804cd0f8579f025cda328db072fcf5 (diff)
downloadethtool-0b49ed378aa5ad23b8e6a102570cd8904d1f0b07.tar.gz
netlink: mark unused parameters of parser callbacks
Some calbacks used with nl_parser() do not use all parameters passed to them. Mark unused parameters explicitly to get rid of compiler warnings. Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
-rw-r--r--netlink/parser.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/netlink/parser.c b/netlink/parser.c
index f152a82..395bd57 100644
--- a/netlink/parser.c
+++ b/netlink/parser.c
@@ -155,8 +155,9 @@ static int lookup_u8(const char *arg, uint8_t *result,
/* Parser handler for a flag. Expects a name (with no additional argument),
* generates NLA_FLAG or sets a bool (if the name was present).
*/
-int nl_parse_flag(struct nl_context *nlctx, uint16_t type, const void *data,
- struct nl_msg_buff *msgbuff, void *dest)
+int nl_parse_flag(struct nl_context *nlctx __maybe_unused, uint16_t type,
+ const void *data __maybe_unused, struct nl_msg_buff *msgbuff,
+ void *dest)
{
if (dest)
*(bool *)dest = true;
@@ -166,7 +167,8 @@ int nl_parse_flag(struct nl_context *nlctx, uint16_t type, const void *data,
/* Parser handler for null terminated string. Expects a string argument,
* generates NLA_NUL_STRING or fills const char *
*/
-int nl_parse_string(struct nl_context *nlctx, uint16_t type, const void *data,
+int nl_parse_string(struct nl_context *nlctx, uint16_t type,
+ const void *data __maybe_unused,
struct nl_msg_buff *msgbuff, void *dest)
{
const char *arg = *nlctx->argp;
@@ -183,8 +185,8 @@ int nl_parse_string(struct nl_context *nlctx, uint16_t type, const void *data,
* (may use 0x prefix), generates NLA_U32 or fills an uint32_t.
*/
int nl_parse_direct_u32(struct nl_context *nlctx, uint16_t type,
- const void *data, struct nl_msg_buff *msgbuff,
- void *dest)
+ const void *data __maybe_unused,
+ struct nl_msg_buff *msgbuff, void *dest)
{
const char *arg = *nlctx->argp;
uint32_t val;
@@ -207,8 +209,8 @@ int nl_parse_direct_u32(struct nl_context *nlctx, uint16_t type,
* (may use 0x prefix), generates NLA_U32 or fills an uint32_t.
*/
int nl_parse_direct_u8(struct nl_context *nlctx, uint16_t type,
- const void *data, struct nl_msg_buff *msgbuff,
- void *dest)
+ const void *data __maybe_unused,
+ struct nl_msg_buff *msgbuff, void *dest)
{
const char *arg = *nlctx->argp;
uint8_t val;
@@ -231,8 +233,8 @@ int nl_parse_direct_u8(struct nl_context *nlctx, uint16_t type,
* NLA_U32 or fills an uint32_t.
*/
int nl_parse_direct_m2cm(struct nl_context *nlctx, uint16_t type,
- const void *data, struct nl_msg_buff *msgbuff,
- void *dest)
+ const void *data __maybe_unused,
+ struct nl_msg_buff *msgbuff, void *dest)
{
const char *arg = *nlctx->argp;
float meters;
@@ -256,7 +258,8 @@ int nl_parse_direct_m2cm(struct nl_context *nlctx, uint16_t type,
/* Parser handler for (tri-state) bool. Expects "name on|off", generates
* NLA_U8 which is 1 for "on" and 0 for "off".
*/
-int nl_parse_u8bool(struct nl_context *nlctx, uint16_t type, const void *data,
+int nl_parse_u8bool(struct nl_context *nlctx, uint16_t type,
+ const void *data __maybe_unused,
struct nl_msg_buff *msgbuff, void *dest)
{
const char *arg = *nlctx->argp;
@@ -463,8 +466,9 @@ err:
* error_parser_params (error message, return value and number of extra
* arguments to skip).
*/
-int nl_parse_error(struct nl_context *nlctx, uint16_t type, const void *data,
- struct nl_msg_buff *msgbuff, void *dest)
+int nl_parse_error(struct nl_context *nlctx, uint16_t type __maybe_unused,
+ const void *data, struct nl_msg_buff *msgbuff __maybe_unused,
+ void *dest __maybe_unused)
{
const struct error_parser_data *parser_data = data;
unsigned int skip = parser_data->extra_args;