From patchwork Sun Sep 4 18:23:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16673 X-Patchwork-Delegate: sven@narfation.org Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 4ABD380769; Sun, 4 Sep 2016 20:23:38 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=narfation.org Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=narfation.org header.i=@narfation.org header.b=hI2ojdBU; dkim-adsp=fail (unprotected policy); dkim-atps=neutral Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=pass header.from=narfation.org Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id 617E080571 for ; Sun, 4 Sep 2016 20:23:36 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593C69DFD0000000000002E17.dip0.t-ipconnect.de [IPv6:2003:c5:93c6:9dfd::2e17]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id C785C1100B0; Sun, 4 Sep 2016 20:23:35 +0200 (CEST) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1473013415; bh=YPPakutm73jgmJZ3KnEUqHemBcwZZch+0CRE8Oh5/N4=; h=From:To:Cc:Subject:Date:From; b=hI2ojdBU3oN7Za7xcUKB0oknf0uCDMZU0oYPtswuMTFFE8TEkun6u6EkAS05Q1PMX MrEYhYWvZiNfYbNfSD1FfGpcNoLPvInAeiGn1R/yB0adifY6J3zc5XQyHKwIAuP/O1 /uE5PWfqZD4TAaKQw5Zpsdj6GxSs7fgWMPLmztzg= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 4 Sep 2016 20:23:31 +0200 Message-Id: <20160904182331.18118-1-sven@narfation.org> X-Mailer: git-send-email 2.9.3 Subject: [B.A.T.M.A.N.] [PATCH] batctl: Work around uclibc collision for __unused X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" 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 Tested-by: Andreas Pape --- genl.c | 4 ++-- main.h | 2 +- netlink.c | 10 +++++----- tp_meter.c | 5 +++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/genl.c b/genl.c index b6f66fd..36fc27e 100644 --- a/genl.c +++ b/genl.c @@ -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; diff --git a/main.h b/main.h index 6365cdb..dbde6dd 100644 --- a/main.h +++ b/main.h @@ -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 */ diff --git a/netlink.c b/netlink.c index e8e94b2..8fce3d8 100644 --- a/netlink.c +++ b/netlink.c @@ -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; diff --git a/tp_meter.c b/tp_meter.c index 43c19da..a402e45 100644 --- a/tp_meter.c +++ b/tp_meter.c @@ -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; }