From: Ben Hutchings <bhutchings@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-net-drivers@solarflare.com>
Subject: [PATCH net-next 16/32] sfc: Consistently test DEBUG macro, not EFX_ENABLE_DEBUG
Date: Fri, 27 Jan 2012 20:46:55 +0000 [thread overview]
Message-ID: <1327697215.2503.23.camel@bwh-desktop> (raw)
In-Reply-To: <1327696858.2503.7.camel@bwh-desktop>
The netif_dbg() macro is defined in <linux/netdevice.h>. If the DEBUG
macro is defined, it logs a message at 'debug' level, otherwise it
does nothing.
In net_driver.h we define DEBUG if EFX_ENABLE_DEBUG is defined, but
this is too late for those source files that already got a
definition of netif_dbg() by including <linux/netdevice.h>
Get rid of EFX_ENABLE_DEBUG, and only define and test DEBUG.
In mtd.c, we do not use DEBUG as a condition flag but are forced to
use the DEBUG macro-function from <linux/mtd/mtd.h>. Undefine DEBUG
before including it.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/ethernet/sfc/mtd.c | 1 +
drivers/net/ethernet/sfc/net_driver.h | 6 +-----
drivers/net/ethernet/sfc/nic.c | 2 +-
drivers/net/ethernet/sfc/selftest.c | 2 +-
4 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/sfc/mtd.c b/drivers/net/ethernet/sfc/mtd.c
index 7f61cd3..b702862 100644
--- a/drivers/net/ethernet/sfc/mtd.c
+++ b/drivers/net/ethernet/sfc/mtd.c
@@ -10,6 +10,7 @@
#include <linux/bitops.h>
#include <linux/module.h>
+#undef DEBUG /* <linux/mtd/mtd.h> has its own use for DEBUG */
#include <linux/mtd/mtd.h>
#include <linux/delay.h>
#include <linux/slab.h>
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index a88e95f..4cbd997 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -13,10 +13,6 @@
#ifndef EFX_NET_DRIVER_H
#define EFX_NET_DRIVER_H
-#if defined(EFX_ENABLE_DEBUG) && !defined(DEBUG)
-#define DEBUG
-#endif
-
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
@@ -42,7 +38,7 @@
#define EFX_DRIVER_VERSION "3.1"
-#ifdef EFX_ENABLE_DEBUG
+#ifdef DEBUG
#define EFX_BUG_ON_PARANOID(x) BUG_ON(x)
#define EFX_WARN_ON_PARANOID(x) WARN_ON(x)
#else
diff --git a/drivers/net/ethernet/sfc/nic.c b/drivers/net/ethernet/sfc/nic.c
index b1df2f3..bf07bd0 100644
--- a/drivers/net/ethernet/sfc/nic.c
+++ b/drivers/net/ethernet/sfc/nic.c
@@ -801,7 +801,7 @@ static void efx_handle_rx_not_ok(struct efx_rx_queue *rx_queue,
* error message. FRM_TRUNC indicates RXDP dropped the packet due
* to a FIFO overflow.
*/
-#ifdef EFX_ENABLE_DEBUG
+#ifdef DEBUG
if (rx_ev_other_err && net_ratelimit()) {
netif_dbg(efx, rx_err, efx->net_dev,
" RX queue %d unexpected RX event "
diff --git a/drivers/net/ethernet/sfc/selftest.c b/drivers/net/ethernet/sfc/selftest.c
index 9df2a79..7718287 100644
--- a/drivers/net/ethernet/sfc/selftest.c
+++ b/drivers/net/ethernet/sfc/selftest.c
@@ -315,7 +315,7 @@ void efx_loopback_rx_packet(struct efx_nic *efx,
return;
err:
-#ifdef EFX_ENABLE_DEBUG
+#ifdef DEBUG
if (atomic_read(&state->rx_bad) == 0) {
netif_err(efx, drv, efx->net_dev, "received packet:\n");
print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 0x10, 1,
--
1.7.7.5
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2012-01-27 20:46 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-27 20:40 pull request: sfc-next 2012-01-27 Ben Hutchings
2012-01-27 20:42 ` [PATCH net-next 01/32] sfc: Fix some formatting errors reported by checkpatch Ben Hutchings
2012-01-27 20:42 ` [PATCH net-next 02/32] sfc: Avoid assignment in an if-statement, " Ben Hutchings
2012-01-27 20:42 ` [PATCH net-next 03/32] sfc: Remove parentheses around return expressions, " Ben Hutchings
2012-01-27 21:01 ` Joe Perches
2012-01-30 16:45 ` Ben Hutchings
2012-01-27 20:43 ` [PATCH net-next 04/32] sfc: Const-qualify static data as appropriate, partly prompted " Ben Hutchings
2012-01-27 20:43 ` [PATCH net-next 05/32] sfc: Remove unnecessary inclusion of <asm/io.h>, " Ben Hutchings
2012-01-27 20:43 ` [PATCH net-next 06/32] sfc: Update MCDI (firmware interface) definitions Ben Hutchings
2012-01-27 20:44 ` [PATCH net-next 07/32] sfc: Rename efx_wanted_channels() to efx_wanted_parallelism() Ben Hutchings
2012-01-27 20:44 ` [PATCH net-next 08/32] sfc: Set default parallelism to per-core by default Ben Hutchings
2012-01-27 20:44 ` [PATCH net-next 09/32] sfc: Remove fallback for invalid permanent MAC address Ben Hutchings
2012-01-27 20:45 ` [PATCH net-next 10/32] sfc: Make handling of MC reboot more reliable Ben Hutchings
2012-01-27 20:45 ` [PATCH net-next 11/32] sfc: Use new names for MC shared memory layout constants Ben Hutchings
2012-01-27 20:45 ` [PATCH net-next 12/32] sfc: Hold efx_nic::stats_lock while reading efx_nic::mac_stats Ben Hutchings
2012-01-27 20:45 ` [PATCH net-next 13/32] sfc: Merge efx_mac_operations into efx_nic_type Ben Hutchings
2012-01-27 20:46 ` [PATCH net-next 14/32] sfc: Merge efx_mcdi_mac_check_fault() and efx_mcdi_get_mac_faults() Ben Hutchings
2012-01-27 20:46 ` [PATCH net-next 15/32] sfc: Remove efx_nic_type::push_multicast_hash operation Ben Hutchings
2012-01-27 20:46 ` Ben Hutchings [this message]
2012-01-27 20:47 ` [PATCH net-next 17/32] sfc: Support extraction of CAPABILITIES from GET_BOARD_CFG response Ben Hutchings
2012-01-27 20:48 ` [PATCH net-next 18/32] sfc: Correct interrupt timer quantum for Siena (normal and turbo mode) Ben Hutchings
2012-01-27 20:48 ` [PATCH net-next 19/32] sfc: Remove dependence on NAPI polling in efx_test_eventq_irq() Ben Hutchings
2012-01-27 20:48 ` [PATCH net-next 20/32] Partly revert "sfc: Handle serious errors in exactly one interrupt handler" Ben Hutchings
2012-01-27 20:49 ` [PATCH net-next 21/32] sfc: Clean up test interrupt handling Ben Hutchings
2012-01-27 20:49 ` [PATCH net-next 22/32] sfc: Add hwmon driver for boards using SFC9000-family controllers Ben Hutchings
2012-01-27 20:50 ` [PATCH net-next 23/32] sfc: Update the description of SFC_MTD Ben Hutchings
2012-01-27 20:50 ` [PATCH net-next 24/32] sfc: Remove obsolete function efx_dev_name() Ben Hutchings
2012-01-27 20:50 ` [PATCH net-next 25/32] sfc: Remove remnants of on-load self-test Ben Hutchings
2012-01-27 20:51 ` [PATCH net-next 26/32] sfc: Use existing local variables instead of repeated indirect lookups Ben Hutchings
2012-01-27 20:51 ` [PATCH net-next 27/32] sfc: Minor formatting fixes Ben Hutchings
2012-01-27 20:51 ` [PATCH net-next 28/32] sfc: Remove redundant 'rc' variable, always set to 0 Ben Hutchings
2012-01-27 20:52 ` [PATCH net-next 29/32] sfc: Rename implementation of ndo_set_rx_mode Ben Hutchings
2012-01-27 20:53 ` [PATCH net-next 30/32] sfc: Make all MAC statistics consistently 64 bits wide Ben Hutchings
2012-01-27 20:54 ` [PATCH net-next 31/32] sfc: Move the end of the non-GRO RX path into its own function Ben Hutchings
2012-01-27 20:54 ` [PATCH net-next 32/32] sfc: Replace efx_rx_buffer::is_page and other booleans with a flags field Ben Hutchings
2012-01-29 21:18 ` pull request: sfc-next 2012-01-27 David Miller
2012-01-29 21:40 ` Ben Hutchings
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=1327697215.2503.23.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=linux-net-drivers@solarflare.com \
--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;
as well as URLs for NNTP newsgroup(s).