batman-adv: upgrade package to latest release 2016.4
[feed/routing.git] / batctl / patches / 0001-batctl-Work-around-uclibc-collision-for-__unused.patch
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
4
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)).
9
10 This can be avoided by renaming it to the Linux kernel name
11 "__maybe_unused".
12
13 Signed-off-by: Sven Eckelmann <sven@narfation.org>
14 ---
15 genl.c | 4 ++--
16 main.h | 2 +-
17 tp_meter.c | 5 +++--
18 3 files changed, 6 insertions(+), 5 deletions(-)
19
20 diff --git a/genl.c b/genl.c
21 index b6f66fd..36fc27e 100644
22 --- a/genl.c
23 +++ b/genl.c
24 @@ -34,7 +34,7 @@
25
26 #include "batman_adv.h"
27
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)
31 {
32 int *ret = arg;
33 @@ -42,7 +42,7 @@ static int mcast_error_handler(struct sockaddr_nl *nla __unused,
34 return NL_STOP;
35 }
36
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)
39 {
40 int *ret = arg;
41 *ret = 0;
42 diff --git a/main.h b/main.h
43 index 01f70e8..12c33b7 100644
44 --- a/main.h
45 +++ b/main.h
46 @@ -47,7 +47,7 @@
47 #endif
48
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 */
53
54 typedef uint8_t u8; /* linux kernel compat */
55 diff --git a/tp_meter.c b/tp_meter.c
56 index 43c19da..a402e45 100644
57 --- a/tp_meter.c
58 +++ b/tp_meter.c
59 @@ -66,7 +66,7 @@ struct tp_cookie {
60 uint32_t cookie;
61 };
62
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,
66 void *arg)
67 {
68 @@ -236,7 +236,8 @@ out:
69 return err;
70 }
71
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)
75 {
76 return NL_OK;
77 }