]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sfc: Consistently test DEBUG macro, not EFX_ENABLE_DEBUG
authorBen Hutchings <bhutchings@solarflare.com>
Fri, 4 Nov 2011 22:29:14 +0000 (22:29 +0000)
committerBen Hutchings <bhutchings@solarflare.com>
Fri, 27 Jan 2012 00:10:48 +0000 (00:10 +0000)
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
drivers/net/ethernet/sfc/net_driver.h
drivers/net/ethernet/sfc/nic.c
drivers/net/ethernet/sfc/selftest.c

index 7f61cd3812d96471f69b2cfe22b49a34774b66d9..b702862a09244f8efd2bf4923eaa44389f234ce3 100644 (file)
@@ -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>
index a88e95f58b0acdb9b5a0ed0851cdd6d6c94808a4..4cbd997e378bfb306f08f078be90befb1f2f22af 100644 (file)
 #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
index b1df2f39c8f01085e468baa3d1e188e57440d270..bf07bd0488cf5757d938f6fdac14ddacc654d387 100644 (file)
@@ -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 "
index 9df2a79425098dd48fe7b5d779bc4a1511db9ace..7718287ad0bc2353e75172e574ecf752a796883c 100644 (file)
@@ -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,