From: Antonio Quartulli <ordex@autistici.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org,
Antonio Quartulli <ordex@autistici.org>
Subject: [PATCH 09/11] batman-adv: refactor tt_global_del_struct()
Date: Tue, 13 Nov 2012 10:15:37 +0100 [thread overview]
Message-ID: <1352798139-19458-10-git-send-email-ordex@autistici.org> (raw)
In-Reply-To: <1352798139-19458-1-git-send-email-ordex@autistici.org>
batadv_tt_global_del_struct() function is not properly named.
Having a more meaningful name which reflects the current behavior helps other
developers to easily understand what it does.
A parameter has also been renamed in order to let the function header better fit
the 80-chars line-width
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
net/batman-adv/translation-table.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index c24e604..cb8433a 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -927,18 +927,17 @@ batadv_tt_global_del_orig_entry(struct batadv_priv *bat_priv,
spin_unlock_bh(&tt_global_entry->list_lock);
}
-static void
-batadv_tt_global_del_struct(struct batadv_priv *bat_priv,
- struct batadv_tt_global_entry *tt_global_entry,
- const char *message)
+static void batadv_tt_global_free(struct batadv_priv *bat_priv,
+ struct batadv_tt_global_entry *tt_global,
+ const char *message)
{
batadv_dbg(BATADV_DBG_TT, bat_priv,
"Deleting global tt entry %pM: %s\n",
- tt_global_entry->common.addr, message);
+ tt_global->common.addr, message);
batadv_hash_remove(bat_priv->tt.global_hash, batadv_compare_tt,
- batadv_choose_orig, tt_global_entry->common.addr);
- batadv_tt_global_entry_free_ref(tt_global_entry);
+ batadv_choose_orig, tt_global->common.addr);
+ batadv_tt_global_entry_free_ref(tt_global);
}
@@ -1002,8 +1001,8 @@ static void batadv_tt_global_del(struct batadv_priv *bat_priv,
orig_node, message);
if (hlist_empty(&tt_global_entry->orig_list))
- batadv_tt_global_del_struct(bat_priv, tt_global_entry,
- message);
+ batadv_tt_global_free(bat_priv, tt_global_entry,
+ message);
goto out;
}
@@ -1026,7 +1025,7 @@ static void batadv_tt_global_del(struct batadv_priv *bat_priv,
if (local_entry) {
/* local entry exists, case 2: client roamed to us. */
batadv_tt_global_del_orig_list(tt_global_entry);
- batadv_tt_global_del_struct(bat_priv, tt_global_entry, message);
+ batadv_tt_global_free(bat_priv, tt_global_entry, message);
} else
/* no local entry exists, case 1: check for roaming */
batadv_tt_global_del_roaming(bat_priv, tt_global_entry,
--
1.8.0
next prev parent reply other threads:[~2012-11-13 9:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-13 9:15 pull request: batman-adv 2012-11-13 Antonio Quartulli
[not found] ` <1352798139-19458-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
2012-11-13 9:15 ` [PATCH 01/11] batman-adv: don't rely on positions in struct for hashing Antonio Quartulli
2012-11-13 19:24 ` David Miller
2012-11-13 9:15 ` [PATCH 02/11] batman-adv: fix wrong spinlock inline comment Antonio Quartulli
2012-11-13 9:15 ` [PATCH 03/11] batman-adv: prevent using any virtual device created on batman-adv as hard-interface Antonio Quartulli
2012-11-13 9:15 ` [PATCH 04/11] batman-adv: send announcement when backbone gw is registered Antonio Quartulli
2012-11-13 9:15 ` [PATCH 05/11] batman-adv: allow bla traffic only after first worker period Antonio Quartulli
2012-11-13 9:15 ` [PATCH 06/11] batman-adv: wait multiple periods before activating bla Antonio Quartulli
2012-11-13 9:15 ` [PATCH 07/11] batman-adv: substitute tt_poss_change with a per-tt_entry flag Antonio Quartulli
2012-11-13 9:15 ` [PATCH 08/11] batman-adv: refactor code to simplify long lines Antonio Quartulli
2012-11-13 9:15 ` Antonio Quartulli [this message]
2012-11-13 9:15 ` [PATCH 10/11] batman-adv: roaming handling mechanism redesign Antonio Quartulli
2012-11-13 9:15 ` [PATCH 11/11] batman-adv: Remove instant overwritten variable initialization Antonio Quartulli
-- strict thread matches above, loose matches on Subject: below --
2012-11-14 20:16 pull request: batman-adv 2012-11-14 Antonio Quartulli
2012-11-14 20:16 ` [PATCH 09/11] batman-adv: refactor tt_global_del_struct() Antonio Quartulli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1352798139-19458-10-git-send-email-ordex@autistici.org \
--to=ordex@autistici.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox