Commit ecbd5321 authored by Marek Lindner's avatar Marek Lindner Committed by Sven Eckelmann

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: default avatarMarek Lindner <lindner_marek@yahoo.de>
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
parent e8958dbf
...@@ -151,7 +151,7 @@ static void new_aggregated_packet(const unsigned char *packet_buff, ...@@ -151,7 +151,7 @@ static void new_aggregated_packet(const unsigned char *packet_buff,
forw_packet_aggr->own = own_packet; forw_packet_aggr->own = own_packet;
forw_packet_aggr->if_incoming = if_incoming; forw_packet_aggr->if_incoming = if_incoming;
forw_packet_aggr->num_packets = 0; 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; forw_packet_aggr->send_time = send_time;
/* save packet direct link flag status */ /* save packet direct link flag status */
......
...@@ -322,7 +322,7 @@ void gw_node_update(struct bat_priv *bat_priv, ...@@ -322,7 +322,7 @@ void gw_node_update(struct bat_priv *bat_priv,
gw_node->deleted = 0; gw_node->deleted = 0;
if (new_gwflags == 0) { if (new_gwflags == NO_FLAGS) {
gw_node->deleted = jiffies; gw_node->deleted = jiffies;
bat_dbg(DBG_BATMAN, bat_priv, bat_dbg(DBG_BATMAN, bat_priv,
"Gateway %pM removed from gateway list\n", "Gateway %pM removed from gateway list\n",
...@@ -335,7 +335,7 @@ void gw_node_update(struct bat_priv *bat_priv, ...@@ -335,7 +335,7 @@ void gw_node_update(struct bat_priv *bat_priv,
goto unlock; goto unlock;
} }
if (new_gwflags == 0) if (new_gwflags == NO_FLAGS)
goto unlock; goto unlock;
gw_node_add(bat_priv, orig_node, new_gwflags); gw_node_add(bat_priv, orig_node, new_gwflags);
......
...@@ -337,7 +337,7 @@ int hardif_enable_interface(struct hard_iface *hard_iface, ...@@ -337,7 +337,7 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
batman_packet = (struct batman_packet *)(hard_iface->packet_buff); batman_packet = (struct batman_packet *)(hard_iface->packet_buff);
batman_packet->packet_type = BAT_PACKET; batman_packet->packet_type = BAT_PACKET;
batman_packet->version = COMPAT_VERSION; batman_packet->version = COMPAT_VERSION;
batman_packet->flags = 0; batman_packet->flags = NO_FLAGS;
batman_packet->ttl = 2; batman_packet->ttl = 2;
batman_packet->tq = TQ_MAX_VALUE; batman_packet->tq = TQ_MAX_VALUE;
batman_packet->num_tt = 0; batman_packet->num_tt = 0;
......
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
#define TQ_LOCAL_BIDRECT_RECV_MINIMUM 1 #define TQ_LOCAL_BIDRECT_RECV_MINIMUM 1
#define TQ_TOTAL_BIDRECT_LIMIT 1 #define TQ_TOTAL_BIDRECT_LIMIT 1
#define NO_FLAGS 0
#define NUM_WORDS (TQ_LOCAL_WINDOW_SIZE / WORD_BIT_SIZE) #define NUM_WORDS (TQ_LOCAL_WINDOW_SIZE / WORD_BIT_SIZE)
#define LOG_BUF_LEN 8192 /* has to be a power of 2 */ #define LOG_BUF_LEN 8192 /* has to be a power of 2 */
......
...@@ -289,7 +289,7 @@ void schedule_own_packet(struct hard_iface *hard_iface) ...@@ -289,7 +289,7 @@ void schedule_own_packet(struct hard_iface *hard_iface)
batman_packet->gw_flags = batman_packet->gw_flags =
(uint8_t)atomic_read(&bat_priv->gw_bandwidth); (uint8_t)atomic_read(&bat_priv->gw_bandwidth);
else else
batman_packet->gw_flags = 0; batman_packet->gw_flags = NO_FLAGS;
atomic_inc(&hard_iface->seqno); atomic_inc(&hard_iface->seqno);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment