@@ -34,7 +34,7 @@
#include "batman_adv.h"
-static int mcast_error_handler(struct sockaddr_nl *nla __unused,
+static int mcast_error_handler(struct sockaddr_nl *nla __maybe_unused,
struct nlmsgerr *err, void *arg)
{
int *ret = arg;
@@ -42,7 +42,7 @@ static int mcast_error_handler(struct sockaddr_nl *nla __unused,
return NL_STOP;
}
-static int mcast_ack_handler(struct nl_msg *msg __unused, void *arg)
+static int mcast_ack_handler(struct nl_msg *msg __maybe_unused, void *arg)
{
int *ret = arg;
*ret = 0;
@@ -47,7 +47,7 @@
#endif
#define __packed __attribute((packed)) /* linux kernel compat */
-#define __unused __attribute__((unused))
+#define __maybe_unused __attribute__((unused))
#define BIT(nr) (1UL << (nr)) /* linux kernel compat */
typedef uint8_t u8; /* linux kernel compat */
@@ -134,9 +134,9 @@ static int missing_mandatory_attrs(struct nlattr *attrs[],
return 0;
}
-static int print_error(struct sockaddr_nl *nla __unused,
+static int print_error(struct sockaddr_nl *nla __maybe_unused,
struct nlmsgerr *nlerr,
- void *arg __unused)
+ void *arg __maybe_unused)
{
if (nlerr->error != -EOPNOTSUPP)
fprintf(stderr, "Error received: %s\n",
@@ -147,7 +147,7 @@ static int print_error(struct sockaddr_nl *nla __unused,
return NL_STOP;
}
-static int stop_callback(struct nl_msg *msg, void *arg __unused)
+static int stop_callback(struct nl_msg *msg, void *arg __maybe_unused)
{
struct nlmsghdr *nlh = nlmsg_hdr(msg);
int *error = nlmsg_data(nlh);
@@ -345,7 +345,7 @@ static const int routing_algos_mandatory[] = {
BATADV_ATTR_ALGO_NAME,
};
-static int routing_algos_callback(struct nl_msg *msg, void *arg __unused)
+static int routing_algos_callback(struct nl_msg *msg, void *arg __maybe_unused)
{
struct nlattr *attrs[BATADV_ATTR_MAX+1];
struct nlmsghdr *nlh = nlmsg_hdr(msg);
@@ -1286,7 +1286,7 @@ int netlink_print_bla_backbone(char *mesh_iface, char *orig_iface, int read_opts
bla_backbone_callback);
}
-static int nlquery_error_cb(struct sockaddr_nl *nla __unused,
+static int nlquery_error_cb(struct sockaddr_nl *nla __maybe_unused,
struct nlmsgerr *nlerr, void *arg)
{
struct nlquery_opts *query_opts = arg;
@@ -66,7 +66,7 @@ struct tp_cookie {
uint32_t cookie;
};
-static int tpmeter_nl_print_error(struct sockaddr_nl *nla __unused,
+static int tpmeter_nl_print_error(struct sockaddr_nl *nla __maybe_unused,
struct nlmsgerr *nlerr,
void *arg)
{
@@ -236,7 +236,8 @@ out:
return err;
}
-static int no_seq_check(struct nl_msg *msg __unused, void *arg __unused)
+static int no_seq_check(struct nl_msg *msg __maybe_unused,
+ void *arg __maybe_unused)
{
return NL_OK;
}
uclibc on 64 bit systems uses struct members called __unused. These conflict with the definition of __unused in batctl. Such a conflict results in a build error because the struct member will be replaced with the __attribute__((unused)). This can be avoided by renaming it to the Linux kernel name "__maybe_unused". Signed-off-by: Sven Eckelmann <sven@narfation.org> --- genl.c | 4 ++-- main.h | 2 +- netlink.c | 10 +++++----- tp_meter.c | 5 +++-- 4 files changed, 11 insertions(+), 10 deletions(-)