aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Lindner <lindner_marek@yahoo.de>2011-06-09 11:13:09 -0400
committerSven Eckelmann <sven@narfation.org>2011-06-09 14:40:38 -0400
commitecbd532108cb21d9d3770f73e168bad65d14d9eb (patch)
tree2755df4a468d6d146e20bed8306e8c76c74f1ce9
parente8958dbf0da377e11f385a9888da3f72e827ab26 (diff)
batman-adv: use NO_FLAGS define instead of hard-coding 0
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>
-rw-r--r--net/batman-adv/aggregation.c2
-rw-r--r--net/batman-adv/gateway_client.c4
-rw-r--r--net/batman-adv/hard-interface.c2
-rw-r--r--net/batman-adv/main.h2
-rw-r--r--net/batman-adv/send.c2
5 files changed, 7 insertions, 5 deletions
diff --git a/net/batman-adv/aggregation.c b/net/batman-adv/aggregation.c
index b41f25b59470..4080970ade7d 100644
--- a/net/batman-adv/aggregation.c
+++ b/net/batman-adv/aggregation.c
@@ -151,7 +151,7 @@ static void new_aggregated_packet(const unsigned char *packet_buff,
151 forw_packet_aggr->own = own_packet; 151 forw_packet_aggr->own = own_packet;
152 forw_packet_aggr->if_incoming = if_incoming; 152 forw_packet_aggr->if_incoming = if_incoming;
153 forw_packet_aggr->num_packets = 0; 153 forw_packet_aggr->num_packets = 0;
154 forw_packet_aggr->direct_link_flags = 0; 154 forw_packet_aggr->direct_link_flags = NO_FLAGS;
155 forw_packet_aggr->send_time = send_time; 155 forw_packet_aggr->send_time = send_time;
156 156
157 /* save packet direct link flag status */ 157 /* save packet direct link flag status */
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index cf7f95e9a952..24aee561f3d8 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -322,7 +322,7 @@ void gw_node_update(struct bat_priv *bat_priv,
322 322
323 gw_node->deleted = 0; 323 gw_node->deleted = 0;
324 324
325 if (new_gwflags == 0) { 325 if (new_gwflags == NO_FLAGS) {
326 gw_node->deleted = jiffies; 326 gw_node->deleted = jiffies;
327 bat_dbg(DBG_BATMAN, bat_priv, 327 bat_dbg(DBG_BATMAN, bat_priv,
328 "Gateway %pM removed from gateway list\n", 328 "Gateway %pM removed from gateway list\n",
@@ -335,7 +335,7 @@ void gw_node_update(struct bat_priv *bat_priv,
335 goto unlock; 335 goto unlock;
336 } 336 }
337 337
338 if (new_gwflags == 0) 338 if (new_gwflags == NO_FLAGS)
339 goto unlock; 339 goto unlock;
340 340
341 gw_node_add(bat_priv, orig_node, new_gwflags); 341 gw_node_add(bat_priv, orig_node, new_gwflags);
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index a3fbfb5c92f1..b55e8616fc1e 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -337,7 +337,7 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
337 batman_packet = (struct batman_packet *)(hard_iface->packet_buff); 337 batman_packet = (struct batman_packet *)(hard_iface->packet_buff);
338 batman_packet->packet_type = BAT_PACKET; 338 batman_packet->packet_type = BAT_PACKET;
339 batman_packet->version = COMPAT_VERSION; 339 batman_packet->version = COMPAT_VERSION;
340 batman_packet->flags = 0; 340 batman_packet->flags = NO_FLAGS;
341 batman_packet->ttl = 2; 341 batman_packet->ttl = 2;
342 batman_packet->tq = TQ_MAX_VALUE; 342 batman_packet->tq = TQ_MAX_VALUE;
343 batman_packet->num_tt = 0; 343 batman_packet->num_tt = 0;
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 27ad734511a9..ed488cbae80f 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -51,6 +51,8 @@
51#define TQ_LOCAL_BIDRECT_RECV_MINIMUM 1 51#define TQ_LOCAL_BIDRECT_RECV_MINIMUM 1
52#define TQ_TOTAL_BIDRECT_LIMIT 1 52#define TQ_TOTAL_BIDRECT_LIMIT 1
53 53
54#define NO_FLAGS 0
55
54#define NUM_WORDS (TQ_LOCAL_WINDOW_SIZE / WORD_BIT_SIZE) 56#define NUM_WORDS (TQ_LOCAL_WINDOW_SIZE / WORD_BIT_SIZE)
55 57
56#define LOG_BUF_LEN 8192 /* has to be a power of 2 */ 58#define LOG_BUF_LEN 8192 /* has to be a power of 2 */
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index d0cfa95e3037..a1b8c3173a3f 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -289,7 +289,7 @@ void schedule_own_packet(struct hard_iface *hard_iface)
289 batman_packet->gw_flags = 289 batman_packet->gw_flags =
290 (uint8_t)atomic_read(&bat_priv->gw_bandwidth); 290 (uint8_t)atomic_read(&bat_priv->gw_bandwidth);
291 else 291 else
292 batman_packet->gw_flags = 0; 292 batman_packet->gw_flags = NO_FLAGS;
293 293
294 atomic_inc(&hard_iface->seqno); 294 atomic_inc(&hard_iface->seqno);
295 295