From patchwork Tue Nov 13 09:15:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 198591 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DB3022C00BF for ; Tue, 13 Nov 2012 20:17:26 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754649Ab2KMJQo (ORCPT ); Tue, 13 Nov 2012 04:16:44 -0500 Received: from contumacia.investici.org ([178.255.144.35]:52760 "EHLO contumacia.investici.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754570Ab2KMJQg (ORCPT ); Tue, 13 Nov 2012 04:16:36 -0500 Received: from [178.255.144.35] (contumacia [178.255.144.35]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 511A5E8906; Tue, 13 Nov 2012 09:16:35 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 contumacia.investici.org 511A5E8906 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1352798195; bh=W5jtwRIBDnMLzTyr1gOCvo66uknHrYdQOfYW5wPrhHQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=DKX7ejWuqbnwnbIDuk00yrVEA2kmXnuyepoEwiHgkOoJAaIBfzVDYxu5HSztcElDi em7m5ZnJWp9GI1vzw4vwLAnaCXHx1hXrgggbDo5S50ckPfy//OoeQa+pm3/Rhtyz60 lM10PlEgH2G9qT1ivGvEWPTtqdt5hZ1aA6qkaRKU= From: Antonio Quartulli To: davem@davemloft.net Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Antonio Quartulli Subject: [PATCH 09/11] batman-adv: refactor tt_global_del_struct() Date: Tue, 13 Nov 2012 10:15:37 +0100 Message-Id: <1352798139-19458-10-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1352798139-19458-1-git-send-email-ordex@autistici.org> References: <1352798139-19458-1-git-send-email-ordex@autistici.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.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 --- 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,