1 From: Sven Eckelmann <sven@narfation.org>
2 Date: Sun, 4 Sep 2016 20:20:40 +0200
3 Subject: [PATCH] batctl: Work around uclibc collision for __unused
5 uclibc on 64 bit systems uses struct members called __unused. These
6 conflict with the definition of __unused in batctl. Such a conflict results
7 in a build error because the struct member will be replaced with the
8 __attribute__((unused)).
10 This can be avoided by renaming it to the Linux kernel name
13 Signed-off-by: Sven Eckelmann <sven@narfation.org>
18 3 files changed, 6 insertions(+), 5 deletions(-)
20 diff --git a/genl.c b/genl.c
21 index b6f66fd..36fc27e 100644
26 #include "batman_adv.h"
28 -static int mcast_error_handler(struct sockaddr_nl *nla __unused,
29 +static int mcast_error_handler(struct sockaddr_nl *nla __maybe_unused,
30 struct nlmsgerr *err, void *arg)
33 @@ -42,7 +42,7 @@ static int mcast_error_handler(struct sockaddr_nl *nla __unused,
37 -static int mcast_ack_handler(struct nl_msg *msg __unused, void *arg)
38 +static int mcast_ack_handler(struct nl_msg *msg __maybe_unused, void *arg)
42 diff --git a/main.h b/main.h
43 index 01f70e8..12c33b7 100644
49 #define __packed __attribute((packed)) /* linux kernel compat */
50 -#define __unused __attribute__((unused))
51 +#define __maybe_unused __attribute__((unused))
52 #define BIT(nr) (1UL << (nr)) /* linux kernel compat */
54 typedef uint8_t u8; /* linux kernel compat */
55 diff --git a/tp_meter.c b/tp_meter.c
56 index 43c19da..a402e45 100644
59 @@ -66,7 +66,7 @@ struct tp_cookie {
63 -static int tpmeter_nl_print_error(struct sockaddr_nl *nla __unused,
64 +static int tpmeter_nl_print_error(struct sockaddr_nl *nla __maybe_unused,
65 struct nlmsgerr *nlerr,
68 @@ -236,7 +236,8 @@ out:
72 -static int no_seq_check(struct nl_msg *msg __unused, void *arg __unused)
73 +static int no_seq_check(struct nl_msg *msg __maybe_unused,
74 + void *arg __maybe_unused)