From patchwork Tue Feb 28 11:32:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 143421 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 D0F33B6EEE for ; Tue, 28 Feb 2012 22:36:30 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965405Ab2B1LgS (ORCPT ); Tue, 28 Feb 2012 06:36:18 -0500 Received: from nm18.bullet.mail.ukl.yahoo.com ([217.146.183.192]:24516 "HELO nm18.bullet.mail.ukl.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S965369Ab2B1LgP (ORCPT ); Tue, 28 Feb 2012 06:36:15 -0500 Received: from [217.146.183.211] by nm18.bullet.mail.ukl.yahoo.com with NNFMP; 28 Feb 2012 11:36:13 -0000 Received: from [217.146.182.74] by tm4.bullet.mail.ukl.yahoo.com with NNFMP; 28 Feb 2012 11:36:13 -0000 Received: from [127.0.0.1] by smtp105.mail.ukl.yahoo.com with NNFMP; 28 Feb 2012 11:36:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1330428973; bh=4r20dHzK0g42vmdV1pb3waz5snlUPIYFCIA7DC+UUs8=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=OTFjUfqRC1Vb97ZOmlKVABKjnhqJHfIJC4gFitmfxxLNAzFz1FtRPoA6c1dGoLr6IdOwWKyM2JIffy3MhpYxZAHdqrvBhgroDxgt3vDauoSeFkFz7lpJ/6LaHsMUp8Fl1/q3DrqPFM1gEvZsDFU3z77GSJdxfV1ig7z6oMAPDyg= X-Yahoo-Newman-Id: 891377.51613.bm@smtp105.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: x3WPwKIVM1ls_YQjcy6bRmzVj0OizTrbw8gp38SYOVnLdGx 3r4PUnTqbVmwo892w6c1UwkAsupTdi07iqlszD0qxAm74skOLNkWe.LTs7Vh thGI3Hp6PxG23PznNIeG7cUcGSIUO5RXmkpuX1CpxvPNk0rKXkUODtnez7R5 _SacQBxLCVnDz5xOUsJ48W3Gj.tUs8CBduAaiUI3YsisZoghH1XRPNeylZ5j 0TjKC2UjZzB3srYBMLxsGGy8SXOfYuJqXG87kXH6etiQO1onck_QHzYKKxlh uTblYFSeD7qar.0Wauerae1kyW.Oi3ia0YzbRAmE9htbTOGao8dULiAy5f9w BseRU07RbWaU0Ln.3watp_jD139PCoXN.nto6h.rLzaem5pBKR8.e9F97Uig 7PtnQRJiwiFKDV5AczlREtKroyRWyBVv5UhbixKgiQT7RUsut0DvaSnB1MfX b5PP5 X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@119.236.110.45 with plain) by smtp105.mail.ukl.yahoo.com with SMTP; 28 Feb 2012 03:36:08 -0800 PST From: Marek Lindner To: davem@davemloft.net Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Antonio Quartulli , Marek Lindner Subject: [PATCH 5/8] batman-adv: code refactoring - move debug print into tt_local_set_pending Date: Tue, 28 Feb 2012 19:32:25 +0800 Message-Id: <1330428748-23137-6-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.9 In-Reply-To: <1330428748-23137-1-git-send-email-lindner_marek@yahoo.de> References: <1330428748-23137-1-git-send-email-lindner_marek@yahoo.de> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Antonio Quartulli 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 Signed-off-by: Marek Lindner --- net/batman-adv/translation-table.c | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 9be9c41..1ff7fbe 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -355,7 +355,7 @@ out: static void tt_local_set_pending(struct bat_priv *bat_priv, struct tt_local_entry *tt_local_entry, - uint16_t flags) + uint16_t flags, const char *message) { tt_local_event(bat_priv, tt_local_entry->common.addr, tt_local_entry->common.flags | flags); @@ -364,6 +364,9 @@ static void tt_local_set_pending(struct bat_priv *bat_priv, * to be kept in the table in order to send it in a full table * response issued before the net ttvn increment (consistency check) */ tt_local_entry->common.flags |= TT_CLIENT_PENDING; + + bat_dbg(DBG_TT, bat_priv, "Local tt entry (%pM) pending to be removed: " + "%s\n", tt_local_entry->common.addr, message); } void 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, goto out; tt_local_set_pending(bat_priv, tt_local_entry, TT_CLIENT_DEL | - (roaming ? TT_CLIENT_ROAM : NO_FLAGS)); - - bat_dbg(DBG_TT, bat_priv, "Local tt entry (%pM) pending to be removed: " - "%s\n", tt_local_entry->common.addr, message); + (roaming ? TT_CLIENT_ROAM : NO_FLAGS), message); out: if (tt_local_entry) tt_local_entry_free_ref(tt_local_entry); @@ -417,10 +417,7 @@ static void tt_local_purge(struct bat_priv *bat_priv) continue; tt_local_set_pending(bat_priv, tt_local_entry, - TT_CLIENT_DEL); - bat_dbg(DBG_TT, bat_priv, "Local tt entry (%pM) " - "pending to be removed: timed out\n", - tt_local_entry->common.addr); + TT_CLIENT_DEL, "timed out"); } spin_unlock_bh(list_lock); }