b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: Fix daily check regression in blaII
@ 2012-02-10 11:21 Sven Eckelmann
  2012-02-11 11:14 ` Marek Lindner
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Eckelmann @ 2012-02-10 11:21 UTC (permalink / raw)
  To: b.a.t.m.a.n

9fd6b0615b5499b270d39a92b8790e206cf75833 introduced some regressions in the
daily checks on open-mesh.org. Those were only visible when
CONFIG_BATMAN_ADV_BLA was disabled. The reason was the usage of defines to
replace the calls for not available functions. The actual c compiler is not
able to distinguish between the used and unused variables because it doesn't
see the function call anymore. The second problem was the use of simple
subscopes where "do {} while(0)" whould have been necessary.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 bridge_loop_avoidance.h |    5 +++--
 soft-interface.c        |    4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/bridge_loop_avoidance.h b/bridge_loop_avoidance.h
index 24d7f16..2758b8c 100644
--- a/bridge_loop_avoidance.h
+++ b/bridge_loop_avoidance.h
@@ -46,9 +46,10 @@ void bla_free(struct bat_priv *bat_priv);
 #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(...)		{}
+#define bla_update_orig_address(...)		do {} while (0)
 #define bla_init(...)				(1)
-#define bla_free(...)				{}
+#define bla_free(...)				do {} while (0)
+
 
 #endif /* ifdef CONFIG_BATMAN_ADV_BLA */
 
diff --git a/soft-interface.c b/soft-interface.c
index 8de8779..579f509 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -132,7 +132,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
 	uint8_t stp_addr[ETH_ALEN] = {0x01, 0x80, 0xC2, 0x00, 0x00, 0x00};
 	unsigned int header_len = 0;
 	int data_len = skb->len, ret;
-	short vid = -1;
+	short vid __maybe_unused = -1;
 	bool do_bcast = false;
 
 	if (atomic_read(&bat_priv->mesh_state) != MESH_ACTIVE)
@@ -253,7 +253,7 @@ void interface_rx(struct net_device *soft_iface,
 	struct bat_priv *bat_priv = netdev_priv(soft_iface);
 	struct ethhdr *ethhdr;
 	struct vlan_ethhdr *vhdr;
-	short vid = -1;
+	short vid __maybe_unused = -1;
 
 	/* check if enough space is available for pulling, and pull */
 	if (!pskb_may_pull(skb, hdr_size))
-- 
1.7.9


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Fix daily check regression in blaII
  2012-02-10 11:21 [B.A.T.M.A.N.] [PATCH] batman-adv: Fix daily check regression in blaII Sven Eckelmann
@ 2012-02-11 11:14 ` Marek Lindner
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2012-02-11 11:14 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Friday, February 10, 2012 19:21:55 Sven Eckelmann wrote:
> 9fd6b0615b5499b270d39a92b8790e206cf75833 introduced some regressions in the
> daily checks on open-mesh.org. Those were only visible when
> CONFIG_BATMAN_ADV_BLA was disabled. The reason was the usage of defines to
> replace the calls for not available functions. The actual c compiler is not
> able to distinguish between the used and unused variables because it
> doesn't see the function call anymore. The second problem was the use of
> simple subscopes where "do {} while(0)" whould have been necessary.

Applied in revision 2c9280e.

Thanks,
Marek

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-11 11:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-10 11:21 [B.A.T.M.A.N.] [PATCH] batman-adv: Fix daily check regression in blaII Sven Eckelmann
2012-02-11 11:14 ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).