From: Sean Anderson <seanga2@gmail.com>
To: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org
Cc: Nick Bowler <nbowler@draconx.ca>,
Rolf Eike Beer <eike-kernel@sf-tec.de>,
Zheyu Ma <zheyuma97@gmail.com>,
linux-kernel@vger.kernel.org (open list),
Sean Anderson <seanga2@gmail.com>
Subject: [PATCH net-next v2 08/13] sunhme: Clean up debug infrastructure
Date: Fri, 23 Sep 2022 21:53:34 -0400 [thread overview]
Message-ID: <20220924015339.1816744-9-seanga2@gmail.com> (raw)
In-Reply-To: <20220924015339.1816744-1-seanga2@gmail.com>
Remove all the single-use debug conditionals, and just collect the debug
defines at the top of the file. HMD seems like it is used for general debug
info, so just redefine it as pr_debug. Additionally, instead of using the
default loglevel, use the debug loglevel for debugging.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
---
(no changes since v1)
drivers/net/ethernet/sun/sunhme.c | 72 ++++++++++++++-----------------
1 file changed, 32 insertions(+), 40 deletions(-)
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
index 77a2a192f2ce..cea99ddc4ce5 100644
--- a/drivers/net/ethernet/sun/sunhme.c
+++ b/drivers/net/ethernet/sun/sunhme.c
@@ -80,13 +80,37 @@ static struct quattro *qfe_sbus_list;
static struct quattro *qfe_pci_list;
#endif
-#undef HMEDEBUG
-#undef SXDEBUG
-#undef RXDEBUG
-#undef TXDEBUG
-#undef TXLOGGING
+#define HMD pr_debug
-#ifdef TXLOGGING
+/* "Auto Switch Debug" aka phy debug */
+#if 0
+#define ASD pr_debug
+#else
+#define ASD(...)
+#endif
+
+/* Transmit debug */
+#if 0
+#define TXD pr_debug
+#else
+#define TXD(...)
+#endif
+
+/* Skid buffer debug */
+#if 0
+#define SXD pr_debug
+#else
+#define SXD(...)
+#endif
+
+/* Receive debug */
+#if 0
+#define RXD pr_debug
+#else
+#define RXD(...)
+#endif
+
+#if 0
struct hme_tx_logent {
unsigned int tstamp;
int tx_new, tx_old;
@@ -129,22 +153,8 @@ static __inline__ void tx_dump_log(void)
}
}
#else
-#define tx_add_log(hp, a, s) do { } while(0)
-#define tx_dump_log() do { } while(0)
-#endif
-
-#ifdef HMEDEBUG
-#define HMD printk
-#else
-#define HMD(...)
-#endif
-
-/* #define AUTO_SWITCH_DEBUG */
-
-#ifdef AUTO_SWITCH_DEBUG
-#define ASD printk
-#else
-#define ASD(...)
+#define tx_add_log(hp, a, s)
+#define tx_dump_log()
#endif
#define DEFAULT_IPG0 16 /* For lance-mode only */
@@ -1842,12 +1852,6 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp)
happy_meal_poll_stop(hp, tregs);
}
-#ifdef TXDEBUG
-#define TXD printk
-#else
-#define TXD(...)
-#endif
-
/* hp->happy_lock must be held */
static void happy_meal_tx(struct happy_meal *hp)
{
@@ -1906,12 +1910,6 @@ static void happy_meal_tx(struct happy_meal *hp)
netif_wake_queue(dev);
}
-#ifdef RXDEBUG
-#define RXD printk
-#else
-#define RXD(...)
-#endif
-
/* Originally I used to handle the allocation failure by just giving back just
* that one ring buffer to the happy meal. Problem is that usually when that
* condition is triggered, the happy meal expects you to do something reasonable
@@ -2173,12 +2171,6 @@ static int happy_meal_close(struct net_device *dev)
return 0;
}
-#ifdef SXDEBUG
-#define SXD printk
-#else
-#define SXD(...)
-#endif
-
static void happy_meal_tx_timeout(struct net_device *dev, unsigned int txqueue)
{
struct happy_meal *hp = netdev_priv(dev);
--
2.37.1
next prev parent reply other threads:[~2022-09-24 1:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-24 1:53 [PATCH net-next v2 00/13] net: sunhme: Cleanups and logging improvements Sean Anderson
2022-09-24 1:53 ` [PATCH net-next v2 01/13] sunhme: remove unused tx_dump_ring() Sean Anderson
2022-09-24 1:53 ` [PATCH net-next v2 02/13] sunhme: Remove version Sean Anderson
2022-09-24 1:53 ` [PATCH net-next v2 03/13] sunhme: forward the error code from pci_enable_device() Sean Anderson
2022-09-24 1:53 ` [PATCH net-next v2 04/13] sunhme: Return an ERR_PTR from quattro_pci_find Sean Anderson
2022-09-24 1:53 ` [PATCH net-next v2 05/13] sunhme: Regularize probe errors Sean Anderson
2022-09-24 1:53 ` [PATCH net-next v2 06/13] sunhme: switch to devres Sean Anderson
2022-09-24 1:53 ` [PATCH net-next v2 07/13] sunhme: Convert FOO((...)) to FOO(...) Sean Anderson
2022-09-27 7:58 ` David Laight
2022-09-27 13:57 ` Sean Anderson
2022-09-24 1:53 ` Sean Anderson [this message]
2022-09-24 1:53 ` [PATCH net-next v2 09/13] sunhme: Convert printk(KERN_FOO ...) to pr_foo(...) Sean Anderson
2022-09-24 1:53 ` [PATCH net-next v2 10/13] sunhme: Use (net)dev_foo wherever possible Sean Anderson
2022-09-24 1:53 ` [PATCH net-next v2 11/13] sunhme: Combine continued messages Sean Anderson
2022-09-24 1:53 ` [PATCH net-next v2 12/13] sunhme: Use vdbg for spam-y prints Sean Anderson
2022-09-24 1:53 ` [PATCH net-next v2 13/13] sunhme: Add myself as a maintainer Sean Anderson
2022-09-27 0:50 ` [PATCH net-next v2 00/13] net: sunhme: Cleanups and logging improvements patchwork-bot+netdevbpf
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=20220924015339.1816744-9-seanga2@gmail.com \
--to=seanga2@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eike-kernel@sf-tec.de \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nbowler@draconx.ca \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=zheyuma97@gmail.com \
/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