* [B.A.T.M.A.N.] [PATCHv2] batman-adv: use static inline functions instead of foo(...)
@ 2012-04-17 11:18 Antonio Quartulli
2012-04-17 11:23 ` Marek Lindner
0 siblings, 1 reply; 2+ messages in thread
From: Antonio Quartulli @ 2012-04-17 11:18 UTC (permalink / raw)
To: b.a.t.m.a.n
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 <ordex@autistici.org>
---
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 */
--
1.7.9.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCHv2] batman-adv: use static inline functions instead of foo(...)
2012-04-17 11:18 [B.A.T.M.A.N.] [PATCHv2] batman-adv: use static inline functions instead of foo(...) Antonio Quartulli
@ 2012-04-17 11:23 ` Marek Lindner
0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2012-04-17 11:23 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
On Tuesday, April 17, 2012 13:18:33 Antonio Quartulli wrote:
> 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
Applied in revision a93ba67.
Thanks,
Marek
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-17 11:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-17 11:18 [B.A.T.M.A.N.] [PATCHv2] batman-adv: use static inline functions instead of foo(...) Antonio Quartulli
2012-04-17 11:23 ` Marek Lindner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox