linux-mips
[Top] [All Lists]

[PATCH net-next v2 16/17] net: mlx4: identify predicate for debug messag

To: "David S. Miller" <davem@davemloft.net>, Ben Hutchings <ben@decadent.org.uk>, Amir Vadai <amirv@mellanox.com>, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-api@vger.kernel.org, linux-mips@linux-mips.org, fcoe-devel@open-fcoe.org
Subject: [PATCH net-next v2 16/17] net: mlx4: identify predicate for debug messages
From: David Decotigny <ddecotig@gmail.com>
Date: Wed, 4 Feb 2015 11:53:40 -0800
Cc: Eric Dumazet <edumazet@google.com>, Eugenia Emantayev <eugenia@mellanox.co.il>, Or Gerlitz <ogerlitz@mellanox.com>, Ido Shamay <idos@mellanox.com>, Joe Perches <joe@perches.com>, Saeed Mahameed <saeedm@mellanox.com>, Govindarajulu Varadarajan <_govind@gmx.com>, Venkata Duvvuru <VenkatKumar.Duvvuru@Emulex.Com>, Jeff Kirsher <jeffrey.t.kirsher@intel.com>, Eyal Perry <eyalpe@mellanox.com>, Pravin B Shelar <pshelar@nicira.com>, Ed Swierk <eswierk@skyportsystems.com>, Upinder Malhi <umalhi@cisco.com>, Robert Love <robert.w.love@intel.com>, "James E.J. Bottomley" <JBottomley@parallels.com>, David Decotigny <decot@googlers.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=w4q0qMqnY1opseEdYnWsuE7GGqKD5eb5dpdQ5rlxsKY=; b=k33Q9PjJ4c+MvYa3TyTz4Tr6p8D/QVkvdukHqLeHAuiJrjELsNYR+Q0kCcoLpaVUho t0/8fNv122xvv/tim1BsDl3kk/7+Ro/EkiNZlZH4zMHPxmOOed9XNhtlxiL01CIWJFg6 CWAdOwVTui84WSyFtUSp7SqPMx2jcRBF43NJW0eCjujFULNnJmTeDpwMUaf5fzUgbKgl uV1xj+2dhnsbtk2oUOjJEYjR21eOc6zuAxMlYwdeatLV7qlp8dqNpT7YY3tLUMknfxSB v891phYcEfIyK3YKVASe3b10YxS7N+fNQajo76H6noPw8h+JPHrJ0mNRl5nFMz+IfUhf SRFg==
In-reply-to: <1423079621-1374-1-git-send-email-ddecotig@gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1423079621-1374-1-git-send-email-ddecotig@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
From: David Decotigny <decot@googlers.com>

Signed-off-by: David Decotigny <decot@googlers.com>
---
 drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h 
b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index 944a112..96bf728 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -869,9 +869,11 @@ __printf(3, 4)
 void en_print(const char *level, const struct mlx4_en_priv *priv,
              const char *format, ...);
 
+#define en_dbg_enabled(mlevel, priv)           \
+       (NETIF_MSG_##mlevel & (priv)->msg_enable)
 #define en_dbg(mlevel, priv, format, ...)                              \
 do {                                                                   \
-       if (NETIF_MSG_##mlevel & (priv)->msg_enable)                    \
+       if (en_dbg_enabled(mlevel, priv))                               \
                en_print(KERN_DEBUG, priv, format, ##__VA_ARGS__);      \
 } while (0)
 #define en_warn(priv, format, ...)                                     \
-- 
2.2.0.rc0.207.ga3a616c


<Prev in Thread] Current Thread [Next in Thread>