Skip to contentSkip to conversation

batman-adv: Print correct function names in dbg messages

PATCH In review Sven Eckelmann 1 participant 2 messages May 19, 2017 – May 23, 2017 Batman advanced

lore
Share & tools
lore

Sven Eckelmann

author maintainer
#0 lore raw

PATCH 1/1 batman-adv: Print correct function names in dbg messages

The function names in batman-adv changed slightly in the past. But some of the debug messages were not updated correctly and therefore some messages were incorrect. To avoid this in the future, these kind of messages should use __func__ to automatically print the correct function name.

---
 net/batman-adv/bat_iv_ogm.c            |  3 +-
 net/batman-adv/bridge_loop_avoidance.c | 72 +++++++++++++++++-----------------
 net/batman-adv/distributed-arp-table.c |  2 +-
 net/batman-adv/routing.c               |  4 +-
 net/batman-adv/send.c                  |  6 +--
 5 files changed, 45 insertions(+), 42 deletions(-)
net/batman-adv/bat_iv_ogm.c +2 -1
index 495ba7c..257b61f 100644
@@ -1022,7 +1022,8 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv,
 	u8 tq_avg;
 
 	batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
-		   "update_originator(): Searching and updating originator entry of received packet\n");
+		   "%s(): Searching and updating originator entry of received packet\n",
+		   __func__);
 
 	rcu_read_lock();
 	hlist_for_each_entry_rcu(tmp_neigh_node,
net/batman-adv/bridge_loop_avoidance.c +37 -35

200 lines not on this page · raw message

net/batman-adv/distributed-arp-table.c +1 -1
index 000ca2f..6930d6b 100644
@@ -601,7 +601,7 @@ batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst,
 						    BATADV_DAT_ADDR_MAX);
 
 	batadv_dbg(BATADV_DBG_DAT, bat_priv,
-		   "dat_select_candidates(): IP=%pI4 hash(IP)=%u\n", &ip_dst,
+		   "%s(): IP=%pI4 hash(IP)=%u\n", __func__, &ip_dst,
 		   ip_key);
 
 	for (select = 0; select < BATADV_DAT_CANDIDATES_NUM; select++)
net/batman-adv/routing.c +2 -2
index ae9f4d3..f10e3ff 100644
@@ -985,8 +985,8 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
 			batadv_orig_node_put(orig_node_gw);
 			if (is_gw) {
 				batadv_dbg(BATADV_DBG_BLA, bat_priv,
-					   "recv_unicast_packet(): Dropped unicast pkt received from another backbone gw %pM.\n",
-					   orig_addr_gw);
+					   "%s(): Dropped unicast pkt received from another backbone gw %pM.\n",
+					   __func__, orig_addr_gw);
 				goto free_skb;
 			}
 		}
net/batman-adv/send.c +3 -3
index 403df59..d239a9d 100644
@@ -971,11 +971,11 @@ batadv_purge_outstanding_packets(struct batadv_priv *bat_priv,
 
 	if (hard_iface)
 		batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
-			   "purge_outstanding_packets(): %s\n",
-			   hard_iface->net_dev->name);
+			   "%s(): %s\n",
+			   __func__, hard_iface->net_dev->name);
 	else
 		batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
-			   "purge_outstanding_packets()\n");
+			   "%s()\n", __func__);
 
 	/* claim bcast list for free() */
 	spin_lock_bh(&bat_priv->forw_bcast_list_lock);
Signature · 1 line
2.11.0
author maintainer
#1 lore raw
Quoted 5 lines · On Freitag, 19. Mai 2017 13:02:00 CEST Sven Eckelmann wrote:

The function names in batman-adv changed slightly in the past. But some of the debug messages were not updated correctly and therefore some messages were incorrect. To avoid this in the future, these kind of messages should use __func__ to automatically print the correct function name.

Quoted 9 lines
---
 net/batman-adv/bat_iv_ogm.c            |  3 +-
 net/batman-adv/bridge_loop_avoidance.c | 72 +++++++++++++++++-----------------
 net/batman-adv/distributed-arp-table.c |  2 +-
 net/batman-adv/routing.c               |  4 +-
 net/batman-adv/send.c                  |  6 +--
 5 files changed, 45 insertions(+), 42 deletions(-)

Patch applied as 4978390e544d496157c6836bbf15270e3039e1c3 [1]

Kind regards,
Sven

[1] https://git.open-mesh.org/batman-adv.git/commit/4978390e544d496157c6836bbf15270e3039e1c3