batman-adv: use NO_FLAGS define instead of hard-coding 0
authorMarek Lindner <lindner_marek@yahoo.de>
Thu, 9 Jun 2011 15:13:09 +0000 (17:13 +0200)
committerSven Eckelmann <sven@narfation.org>
Thu, 9 Jun 2011 18:40:38 +0000 (20:40 +0200)
The definition NO_FLAGS was introduced to make the code more
readable and shall be used to initialize flag fields.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/aggregation.c
net/batman-adv/gateway_client.c
net/batman-adv/hard-interface.c
net/batman-adv/main.h
net/batman-adv/send.c

index b41f25b59470faa386dc877534df156469caa049..4080970ade7de8adf3806966cc680bb14b4a939d 100644 (file)
@@ -151,7 +151,7 @@ static void new_aggregated_packet(const unsigned char *packet_buff,
        forw_packet_aggr->own = own_packet;
        forw_packet_aggr->if_incoming = if_incoming;
        forw_packet_aggr->num_packets = 0;
-       forw_packet_aggr->direct_link_flags = 0;
+       forw_packet_aggr->direct_link_flags = NO_FLAGS;
        forw_packet_aggr->send_time = send_time;
 
        /* save packet direct link flag status */
index cf7f95e9a95200c318f0eb5a314f6c219ba2ef9b..24aee561f3d8749c07530e7b256907c5d7704d76 100644 (file)
@@ -322,7 +322,7 @@ void gw_node_update(struct bat_priv *bat_priv,
 
                gw_node->deleted = 0;
 
-               if (new_gwflags == 0) {
+               if (new_gwflags == NO_FLAGS) {
                        gw_node->deleted = jiffies;
                        bat_dbg(DBG_BATMAN, bat_priv,
                                "Gateway %pM removed from gateway list\n",
@@ -335,7 +335,7 @@ void gw_node_update(struct bat_priv *bat_priv,
                goto unlock;
        }
 
-       if (new_gwflags == 0)
+       if (new_gwflags == NO_FLAGS)
                goto unlock;
 
        gw_node_add(bat_priv, orig_node, new_gwflags);
index a3fbfb5c92f161c2a38760115a307889b69d66e4..b55e8616fc1eddc87cde667c70281300e3e85fda 100644 (file)
@@ -337,7 +337,7 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
        batman_packet = (struct batman_packet *)(hard_iface->packet_buff);
        batman_packet->packet_type = BAT_PACKET;
        batman_packet->version = COMPAT_VERSION;
-       batman_packet->flags = 0;
+       batman_packet->flags = NO_FLAGS;
        batman_packet->ttl = 2;
        batman_packet->tq = TQ_MAX_VALUE;
        batman_packet->num_tt = 0;
index 27ad734511a90ffdcb0677c1a55f534250f244a1..ed488cbae80f985dd11fddb5a65228e9733f2ffb 100644 (file)
@@ -51,6 +51,8 @@
 #define TQ_LOCAL_BIDRECT_RECV_MINIMUM 1
 #define TQ_TOTAL_BIDRECT_LIMIT 1
 
+#define NO_FLAGS 0
+
 #define NUM_WORDS (TQ_LOCAL_WINDOW_SIZE / WORD_BIT_SIZE)
 
 #define LOG_BUF_LEN 8192         /* has to be a power of 2 */
index d0cfa95e30372210fd1b51fd292a76d524230c05..a1b8c3173a3f6f64c98cf4ecbf9ee378fa49bfe7 100644 (file)
@@ -289,7 +289,7 @@ void schedule_own_packet(struct hard_iface *hard_iface)
                batman_packet->gw_flags =
                                (uint8_t)atomic_read(&bat_priv->gw_bandwidth);
        else
-               batman_packet->gw_flags = 0;
+               batman_packet->gw_flags = NO_FLAGS;
 
        atomic_inc(&hard_iface->seqno);