The following commit has been merged in the merge/master branch: commit c7a534179557f01679c9a49067c4c0478a12b9b2 Author: Antonio Quartulli ordex@autistici.org Date: Sat Apr 7 11:51:53 2012 +0200
batman-adv: use inline functions when BLA is not compiled in
In order to correctly check the type of the arguments of function invocations, even if BLA is not compiled in, it is necessary to use inline functions instead of simple defines.
Signed-off-by: Antonio Quartulli ordex@autistici.org
diff --git a/net/batman-adv/bridge_loop_avoidance.h b/net/batman-adv/bridge_loop_avoidance.h index e1a2966..b9efdfa 100644 --- a/net/batman-adv/bridge_loop_avoidance.h +++ b/net/batman-adv/bridge_loop_avoidance.h @@ -40,16 +40,44 @@ void bla_free(struct bat_priv *bat_priv); #define BLA_CRC_INIT 0 #else /* ifdef CONFIG_BATMAN_ADV_BLA */
-#define bla_rx(...) (0) -#define bla_tx(...) (0) -#define bla_is_backbone_gw(...) (0) -#define bla_claim_table_seq_print_text (0) -#define bla_is_backbone_gw_orig(...) (0) -#define bla_check_bcast_duplist(...) (0) -#define bla_update_orig_address(...) do {} while (0) -#define bla_init(...) (1) -#define bla_free(...) do {} while (0) +inline int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) { + return 0; +}
+inline int bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) { + return 0; +} + +inline int bla_is_backbone_gw(struct sk_buff *skb, + struct orig_node *orig_node, int hdr_size) { + return 0; +} + +inline int bla_claim_table_seq_print_text(struct seq_file *seq, void *offset) { + return 0; +} + +inline int bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig) { + return 0; +} + +inline int bla_check_bcast_duplist(struct bat_priv *bat_priv, + struct bcast_packet *bcast_packet, + int hdr_size) { + return 0; +} + +inline void bla_update_orig_address(struct bat_priv *bat_priv, + struct hard_iface *primary_if, + struct hard_iface *oldif) { +} + +inline int bla_init(struct bat_priv *bat_priv) { + return 0; +} + +inline void bla_free(struct bat_priv *bat_priv) { +}
#endif /* ifdef CONFIG_BATMAN_ADV_BLA */