Commit c566dbbef029d7ea957e9566e3073e68b9e05de9

Authored by Antonio Quartulli
Committed by Marek Lindner
1 parent c40ed2bfa6

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>

Showing 1 changed file with 6 additions and 9 deletions Side-by-side Diff

net/batman-adv/translation-table.c
... ... @@ -355,7 +355,7 @@
355 355  
356 356 static void tt_local_set_pending(struct bat_priv *bat_priv,
357 357 struct tt_local_entry *tt_local_entry,
358   - uint16_t flags)
  358 + uint16_t flags, const char *message)
359 359 {
360 360 tt_local_event(bat_priv, tt_local_entry->common.addr,
361 361 tt_local_entry->common.flags | flags);
... ... @@ -364,6 +364,9 @@
364 364 * to be kept in the table in order to send it in a full table
365 365 * response issued before the net ttvn increment (consistency check) */
366 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  
369 372 void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr,
... ... @@ -376,10 +379,7 @@
376 379 goto out;
377 380  
378 381 tt_local_set_pending(bat_priv, tt_local_entry, TT_CLIENT_DEL |
379   - (roaming ? TT_CLIENT_ROAM : NO_FLAGS));
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);
  382 + (roaming ? TT_CLIENT_ROAM : NO_FLAGS), message);
383 383 out:
384 384 if (tt_local_entry)
385 385 tt_local_entry_free_ref(tt_local_entry);
... ... @@ -417,10 +417,7 @@
417 417 continue;
418 418  
419 419 tt_local_set_pending(bat_priv, tt_local_entry,
420   - TT_CLIENT_DEL);
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);
  420 + TT_CLIENT_DEL, "timed out");
424 421 }
425 422 spin_unlock_bh(list_lock);
426 423 }