On Thu, Apr 18, 2013 at 03:43:47PM +0200, Antonio Quartulli wrote:
From: Antonio Quartulli antonio@open-mesh.com
Since the MSB bits of any vid variable are now used for storing flags, print the vid properly by taking the flags away and printing -1 in case of VID representing no real VLAN.
Signed-off-by: Antonio Quartulli antonio@open-mesh.com
bridge_loop_avoidance.c | 57 ++++++++++++++++++++++++++----------------------- main.h | 2 ++ 2 files changed, 32 insertions(+), 27 deletions(-)
diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c index 16f9239..24a62ac 100644 --- a/bridge_loop_avoidance.c +++ b/bridge_loop_avoidance.c @@ -307,7 +307,8 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, uint8_t *mac, */ memcpy(ethhdr->h_source, mac, ETH_ALEN); batadv_dbg(BATADV_DBG_BLA, bat_priv,
"bla_send_claim(): CLAIM %pM on vid %hu\n", mac, vid);
"bla_send_claim(): CLAIM %pM on vid %hd\n", mac,
BATADV_PRINT_VID(vid));
You've changed all these strings from %d into %hu and now back to %hd? Why not just leave everything at %d and reduce the bloat of these patches? It should not hurt anyone - yes, printing -1 is not pretty but this is developer debug info anyway. And keeping %d instead of %hd should not be a problem as far as I understand.
Apart from that, using the BATADV_PRINT_VID macro is a good idea IMHO.
Cheers, Simon