Commit a2f2b6cd authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Antonio Quartulli

batman-adv: Clarify calculation precedence for '&' and '?'

Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
Signed-off-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
parent 1e2c2a4f
...@@ -479,7 +479,7 @@ static void batadv_iv_ogm_send_to_if(struct batadv_forw_packet *forw_packet, ...@@ -479,7 +479,7 @@ static void batadv_iv_ogm_send_to_if(struct batadv_forw_packet *forw_packet,
batadv_ogm_packet->orig, batadv_ogm_packet->orig,
ntohl(batadv_ogm_packet->seqno), ntohl(batadv_ogm_packet->seqno),
batadv_ogm_packet->tq, batadv_ogm_packet->ttl, batadv_ogm_packet->tq, batadv_ogm_packet->ttl,
(batadv_ogm_packet->flags & BATADV_DIRECTLINK ? ((batadv_ogm_packet->flags & BATADV_DIRECTLINK) ?
"on" : "off"), "on" : "off"),
hard_iface->net_dev->name, hard_iface->net_dev->name,
hard_iface->net_dev->dev_addr); hard_iface->net_dev->dev_addr);
......
...@@ -182,7 +182,7 @@ struct batadv_ogm_packet; ...@@ -182,7 +182,7 @@ struct batadv_ogm_packet;
struct seq_file; struct seq_file;
struct sk_buff; struct sk_buff;
#define BATADV_PRINT_VID(vid) (vid & BATADV_VLAN_HAS_TAG ? \ #define BATADV_PRINT_VID(vid) ((vid & BATADV_VLAN_HAS_TAG) ? \
(int)(vid & VLAN_VID_MASK) : -1) (int)(vid & VLAN_VID_MASK) : -1)
extern char batadv_routing_algo[]; extern char batadv_routing_algo[];
......
...@@ -973,17 +973,17 @@ int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset) ...@@ -973,17 +973,17 @@ int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset)
" * %pM %4i [%c%c%c%c%c%c] %3u.%03u (%#.8x)\n", " * %pM %4i [%c%c%c%c%c%c] %3u.%03u (%#.8x)\n",
tt_common_entry->addr, tt_common_entry->addr,
BATADV_PRINT_VID(tt_common_entry->vid), BATADV_PRINT_VID(tt_common_entry->vid),
(tt_common_entry->flags & ((tt_common_entry->flags &
BATADV_TT_CLIENT_ROAM ? 'R' : '.'), BATADV_TT_CLIENT_ROAM) ? 'R' : '.'),
no_purge ? 'P' : '.', no_purge ? 'P' : '.',
(tt_common_entry->flags & ((tt_common_entry->flags &
BATADV_TT_CLIENT_NEW ? 'N' : '.'), BATADV_TT_CLIENT_NEW) ? 'N' : '.'),
(tt_common_entry->flags & ((tt_common_entry->flags &
BATADV_TT_CLIENT_PENDING ? 'X' : '.'), BATADV_TT_CLIENT_PENDING) ? 'X' : '.'),
(tt_common_entry->flags & ((tt_common_entry->flags &
BATADV_TT_CLIENT_WIFI ? 'W' : '.'), BATADV_TT_CLIENT_WIFI) ? 'W' : '.'),
(tt_common_entry->flags & ((tt_common_entry->flags &
BATADV_TT_CLIENT_ISOLA ? 'I' : '.'), BATADV_TT_CLIENT_ISOLA) ? 'I' : '.'),
no_purge ? 0 : last_seen_secs, no_purge ? 0 : last_seen_secs,
no_purge ? 0 : last_seen_msecs, no_purge ? 0 : last_seen_msecs,
vlan->tt.crc); vlan->tt.crc);
...@@ -1547,10 +1547,10 @@ batadv_tt_global_print_entry(struct batadv_priv *bat_priv, ...@@ -1547,10 +1547,10 @@ batadv_tt_global_print_entry(struct batadv_priv *bat_priv,
BATADV_PRINT_VID(tt_global_entry->common.vid), BATADV_PRINT_VID(tt_global_entry->common.vid),
best_entry->ttvn, best_entry->orig_node->orig, best_entry->ttvn, best_entry->orig_node->orig,
last_ttvn, vlan->tt.crc, last_ttvn, vlan->tt.crc,
(flags & BATADV_TT_CLIENT_ROAM ? 'R' : '.'), ((flags & BATADV_TT_CLIENT_ROAM) ? 'R' : '.'),
(flags & BATADV_TT_CLIENT_WIFI ? 'W' : '.'), ((flags & BATADV_TT_CLIENT_WIFI) ? 'W' : '.'),
(flags & BATADV_TT_CLIENT_ISOLA ? 'I' : '.'), ((flags & BATADV_TT_CLIENT_ISOLA) ? 'I' : '.'),
(flags & BATADV_TT_CLIENT_TEMP ? 'T' : '.')); ((flags & BATADV_TT_CLIENT_TEMP) ? 'T' : '.'));
batadv_orig_node_vlan_free_ref(vlan); batadv_orig_node_vlan_free_ref(vlan);
} }
...@@ -1579,10 +1579,10 @@ batadv_tt_global_print_entry(struct batadv_priv *bat_priv, ...@@ -1579,10 +1579,10 @@ batadv_tt_global_print_entry(struct batadv_priv *bat_priv,
BATADV_PRINT_VID(tt_global_entry->common.vid), BATADV_PRINT_VID(tt_global_entry->common.vid),
orig_entry->ttvn, orig_entry->orig_node->orig, orig_entry->ttvn, orig_entry->orig_node->orig,
last_ttvn, vlan->tt.crc, last_ttvn, vlan->tt.crc,
(flags & BATADV_TT_CLIENT_ROAM ? 'R' : '.'), ((flags & BATADV_TT_CLIENT_ROAM) ? 'R' : '.'),
(flags & BATADV_TT_CLIENT_WIFI ? 'W' : '.'), ((flags & BATADV_TT_CLIENT_WIFI) ? 'W' : '.'),
(flags & BATADV_TT_CLIENT_ISOLA ? 'I' : '.'), ((flags & BATADV_TT_CLIENT_ISOLA) ? 'I' : '.'),
(flags & BATADV_TT_CLIENT_TEMP ? 'T' : '.')); ((flags & BATADV_TT_CLIENT_TEMP) ? 'T' : '.'));
batadv_orig_node_vlan_free_ref(vlan); batadv_orig_node_vlan_free_ref(vlan);
} }
...@@ -2548,7 +2548,7 @@ static bool batadv_send_other_tt_response(struct batadv_priv *bat_priv, ...@@ -2548,7 +2548,7 @@ static bool batadv_send_other_tt_response(struct batadv_priv *bat_priv,
batadv_dbg(BATADV_DBG_TT, bat_priv, batadv_dbg(BATADV_DBG_TT, bat_priv,
"Received TT_REQUEST from %pM for ttvn: %u (%pM) [%c]\n", "Received TT_REQUEST from %pM for ttvn: %u (%pM) [%c]\n",
req_src, tt_data->ttvn, req_dst, req_src, tt_data->ttvn, req_dst,
(tt_data->flags & BATADV_TT_FULL_TABLE ? 'F' : '.')); ((tt_data->flags & BATADV_TT_FULL_TABLE) ? 'F' : '.'));
/* Let's get the orig node of the REAL destination */ /* Let's get the orig node of the REAL destination */
req_dst_orig_node = batadv_orig_hash_find(bat_priv, req_dst); req_dst_orig_node = batadv_orig_hash_find(bat_priv, req_dst);
...@@ -2679,7 +2679,7 @@ static bool batadv_send_my_tt_response(struct batadv_priv *bat_priv, ...@@ -2679,7 +2679,7 @@ static bool batadv_send_my_tt_response(struct batadv_priv *bat_priv,
batadv_dbg(BATADV_DBG_TT, bat_priv, batadv_dbg(BATADV_DBG_TT, bat_priv,
"Received TT_REQUEST from %pM for ttvn: %u (me) [%c]\n", "Received TT_REQUEST from %pM for ttvn: %u (me) [%c]\n",
req_src, tt_data->ttvn, req_src, tt_data->ttvn,
(tt_data->flags & BATADV_TT_FULL_TABLE ? 'F' : '.')); ((tt_data->flags & BATADV_TT_FULL_TABLE) ? 'F' : '.'));
spin_lock_bh(&bat_priv->tt.commit_lock); spin_lock_bh(&bat_priv->tt.commit_lock);
...@@ -2918,7 +2918,7 @@ static void batadv_handle_tt_response(struct batadv_priv *bat_priv, ...@@ -2918,7 +2918,7 @@ static void batadv_handle_tt_response(struct batadv_priv *bat_priv,
batadv_dbg(BATADV_DBG_TT, bat_priv, batadv_dbg(BATADV_DBG_TT, bat_priv,
"Received TT_RESPONSE from %pM for ttvn %d t_size: %d [%c]\n", "Received TT_RESPONSE from %pM for ttvn %d t_size: %d [%c]\n",
resp_src, tt_data->ttvn, num_entries, resp_src, tt_data->ttvn, num_entries,
(tt_data->flags & BATADV_TT_FULL_TABLE ? 'F' : '.')); ((tt_data->flags & BATADV_TT_FULL_TABLE) ? 'F' : '.'));
orig_node = batadv_orig_hash_find(bat_priv, resp_src); orig_node = batadv_orig_hash_find(bat_priv, resp_src);
if (!orig_node) if (!orig_node)
......
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