From patchwork Tue Apr 17 11:18:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1727 Return-Path: Received: from latitanza.investici.org (latitanza.investici.org [82.94.249.234]) by open-mesh.org (Postfix) with ESMTPS id D258B6007A2 for ; Tue, 17 Apr 2012 13:17:40 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [82.94.249.234] (latitanza [82.94.249.234]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 12380986A8; Tue, 17 Apr 2012 11:17:39 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 latitanza.investici.org 12380986A8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1334661460; bh=M+f7iTLon3fKgYBdW4V+Y4ThNxU0cEMrr48wsC7tfJ0=; h=From:To:Cc:Subject:Date:Message-Id; b=eig5/hSDBpxSO/sZfJXtTpJZTsfIpVZhSdOdS00vfllLQBA4MYygBYX4YhkkhiVYU W2yyFCtuLaSGM9aKk84OwIrwM3nTATZDdnNEAl9AKbjyIVz+003gqqD1X8jRvyJYCN 1MY6hgYCtNUybgMSQHk5R9sEy+iMbeqBf1e6+l10= From: Antonio Quartulli To: b.a.t.m.a.n@lists.open-mesh.org Date: Tue, 17 Apr 2012 13:18:33 +0200 Message-Id: <1334661513-2261-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.9.4 Subject: [B.A.T.M.A.N.] [PATCHv2] batman-adv: use static inline functions instead of foo(...) X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2012 11:17:41 -0000 When the DAT component is not built, instead of having fake function like foo(...) we must use a static inline function in order to allow the compiler to check the number of the type of the passed arguments Signed-off-by: Antonio Quartulli --- distributed-arp-table.h | 53 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/distributed-arp-table.h b/distributed-arp-table.h index 26b98c0..fcf6c15 100644 --- a/distributed-arp-table.h +++ b/distributed-arp-table.h @@ -88,14 +88,51 @@ static inline void dat_init_own_dht_addr(struct bat_priv *bat_priv, #else -#define dat_snoop_outgoing_arp_request(...) (0) -#define dat_snoop_incoming_arp_request(...) (0) -#define dat_snoop_outgoing_arp_reply(...) -#define dat_snoop_incoming_arp_reply(...) (0) -#define dat_drop_broadcast_packet(...) (0) -#define arp_change_timeout(...) -#define dat_init_orig_node_dht_addr(...) -#define dat_init_own_dht_addr(...) +static inline bool dat_snoop_outgoing_arp_request(struct bat_priv *bat_priv, + struct sk_buff *skb) +{ + return false; +} + +static inline bool dat_snoop_incoming_arp_request(struct bat_priv *bat_priv, + struct sk_buff *skb, + int hdr_size) +{ + return false; +} + +static inline bool dat_snoop_outgoing_arp_reply(struct bat_priv *bat_priv, + struct sk_buff *skb) +{ + return false; +} + +static inline bool dat_snoop_incoming_arp_reply(struct bat_priv *bat_priv, + struct sk_buff *skb, + int hdr_size) +{ + return false; +} + +static inline bool dat_drop_broadcast_packet(struct bat_priv *bat_priv, + struct forw_packet *forw_packet) +{ + return false; +} + +static inline void dat_init_orig_node_dht_addr(struct orig_node *orig_node) +{ +} + +static inline void dat_init_own_dht_addr(struct bat_priv *bat_priv, + struct hard_iface *primary_if) +{ +} + +static inline void arp_change_timeout(struct net_device *soft_iface, + const char *name) +{ +} #endif /* CONFIG_BATMAN_ADV_DAT */