aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2012-01-06 15:31:34 -0500
committerMarek Lindner <lindner_marek@yahoo.de>2012-02-16 13:50:21 -0500
commitc566dbbef029d7ea957e9566e3073e68b9e05de9 (patch)
treec7409e8eef9e6f42ed7d2fdb9b36cb3168310970 /net/batman-adv
parentc40ed2bfa6cc30174d5c547b37bcd6528c830ef4 (diff)
batman-adv: code refactoring - move debug print into tt_local_set_pending
Each tt_local_set_pending is always followed by a bat_dbg invocation. This can be simplified by moving the bat_dbg() call. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/translation-table.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 9be9c41c529b..1ff7fbebf921 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -355,7 +355,7 @@ out:
355 355
356static void tt_local_set_pending(struct bat_priv *bat_priv, 356static void tt_local_set_pending(struct bat_priv *bat_priv,
357 struct tt_local_entry *tt_local_entry, 357 struct tt_local_entry *tt_local_entry,
358 uint16_t flags) 358 uint16_t flags, const char *message)
359{ 359{
360 tt_local_event(bat_priv, tt_local_entry->common.addr, 360 tt_local_event(bat_priv, tt_local_entry->common.addr,
361 tt_local_entry->common.flags | flags); 361 tt_local_entry->common.flags | flags);
@@ -364,6 +364,9 @@ static void tt_local_set_pending(struct bat_priv *bat_priv,
364 * to be kept in the table in order to send it in a full table 364 * to be kept in the table in order to send it in a full table
365 * response issued before the net ttvn increment (consistency check) */ 365 * response issued before the net ttvn increment (consistency check) */
366 tt_local_entry->common.flags |= TT_CLIENT_PENDING; 366 tt_local_entry->common.flags |= TT_CLIENT_PENDING;
367
368 bat_dbg(DBG_TT, bat_priv, "Local tt entry (%pM) pending to be removed: "
369 "%s\n", tt_local_entry->common.addr, message);
367} 370}
368 371
369void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr, 372void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr,
@@ -376,10 +379,7 @@ void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr,
376 goto out; 379 goto out;
377 380
378 tt_local_set_pending(bat_priv, tt_local_entry, TT_CLIENT_DEL | 381 tt_local_set_pending(bat_priv, tt_local_entry, TT_CLIENT_DEL |
379 (roaming ? TT_CLIENT_ROAM : NO_FLAGS)); 382 (roaming ? TT_CLIENT_ROAM : NO_FLAGS), message);
380
381 bat_dbg(DBG_TT, bat_priv, "Local tt entry (%pM) pending to be removed: "
382 "%s\n", tt_local_entry->common.addr, message);
383out: 383out:
384 if (tt_local_entry) 384 if (tt_local_entry)
385 tt_local_entry_free_ref(tt_local_entry); 385 tt_local_entry_free_ref(tt_local_entry);
@@ -417,10 +417,7 @@ static void tt_local_purge(struct bat_priv *bat_priv)
417 continue; 417 continue;
418 418
419 tt_local_set_pending(bat_priv, tt_local_entry, 419 tt_local_set_pending(bat_priv, tt_local_entry,
420 TT_CLIENT_DEL); 420 TT_CLIENT_DEL, "timed out");
421 bat_dbg(DBG_TT, bat_priv, "Local tt entry (%pM) "
422 "pending to be removed: timed out\n",
423 tt_local_entry->common.addr);
424 } 421 }
425 spin_unlock_bh(list_lock); 422 spin_unlock_bh(list_lock);
426 } 423 }