diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-11-04 18:29:14 -0400 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2012-01-26 19:10:48 -0500 |
commit | 5f3f9d6c441faa323444b2f6b092d630fcd7d04c (patch) | |
tree | df8f27bfc7cccad5d2e08b3b6d513b7a5f8eb3b0 | |
parent | 30b81cda9516878906b44fed16aac9df1dbb89c7 (diff) |
sfc: Consistently test DEBUG macro, not EFX_ENABLE_DEBUG
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>
-rw-r--r-- | drivers/net/ethernet/sfc/mtd.c | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/net_driver.h | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/nic.c | 2 | ||||
-rw-r--r-- | 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 7f61cd3812d9..b702862a0924 100644 --- a/drivers/net/ethernet/sfc/mtd.c +++ b/drivers/net/ethernet/sfc/mtd.c | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/bitops.h> | 11 | #include <linux/bitops.h> |
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #undef DEBUG /* <linux/mtd/mtd.h> has its own use for DEBUG */ | ||
13 | #include <linux/mtd/mtd.h> | 14 | #include <linux/mtd/mtd.h> |
14 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
15 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index a88e95f58b0a..4cbd997e378b 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h | |||
@@ -13,10 +13,6 @@ | |||
13 | #ifndef EFX_NET_DRIVER_H | 13 | #ifndef EFX_NET_DRIVER_H |
14 | #define EFX_NET_DRIVER_H | 14 | #define EFX_NET_DRIVER_H |
15 | 15 | ||
16 | #if defined(EFX_ENABLE_DEBUG) && !defined(DEBUG) | ||
17 | #define DEBUG | ||
18 | #endif | ||
19 | |||
20 | #include <linux/netdevice.h> | 16 | #include <linux/netdevice.h> |
21 | #include <linux/etherdevice.h> | 17 | #include <linux/etherdevice.h> |
22 | #include <linux/ethtool.h> | 18 | #include <linux/ethtool.h> |
@@ -42,7 +38,7 @@ | |||
42 | 38 | ||
43 | #define EFX_DRIVER_VERSION "3.1" | 39 | #define EFX_DRIVER_VERSION "3.1" |
44 | 40 | ||
45 | #ifdef EFX_ENABLE_DEBUG | 41 | #ifdef DEBUG |
46 | #define EFX_BUG_ON_PARANOID(x) BUG_ON(x) | 42 | #define EFX_BUG_ON_PARANOID(x) BUG_ON(x) |
47 | #define EFX_WARN_ON_PARANOID(x) WARN_ON(x) | 43 | #define EFX_WARN_ON_PARANOID(x) WARN_ON(x) |
48 | #else | 44 | #else |
diff --git a/drivers/net/ethernet/sfc/nic.c b/drivers/net/ethernet/sfc/nic.c index b1df2f39c8f0..bf07bd0488cf 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, | |||
801 | * error message. FRM_TRUNC indicates RXDP dropped the packet due | 801 | * error message. FRM_TRUNC indicates RXDP dropped the packet due |
802 | * to a FIFO overflow. | 802 | * to a FIFO overflow. |
803 | */ | 803 | */ |
804 | #ifdef EFX_ENABLE_DEBUG | 804 | #ifdef DEBUG |
805 | if (rx_ev_other_err && net_ratelimit()) { | 805 | if (rx_ev_other_err && net_ratelimit()) { |
806 | netif_dbg(efx, rx_err, efx->net_dev, | 806 | netif_dbg(efx, rx_err, efx->net_dev, |
807 | " RX queue %d unexpected RX event " | 807 | " RX queue %d unexpected RX event " |
diff --git a/drivers/net/ethernet/sfc/selftest.c b/drivers/net/ethernet/sfc/selftest.c index 9df2a7942509..7718287ad0bc 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, | |||
315 | return; | 315 | return; |
316 | 316 | ||
317 | err: | 317 | err: |
318 | #ifdef EFX_ENABLE_DEBUG | 318 | #ifdef DEBUG |
319 | if (atomic_read(&state->rx_bad) == 0) { | 319 | if (atomic_read(&state->rx_bad) == 0) { |
320 | netif_err(efx, drv, efx->net_dev, "received packet:\n"); | 320 | netif_err(efx, drv, efx->net_dev, "received packet:\n"); |
321 | print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 0x10, 1, | 321 | print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 0x10, 1, |