From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Joe Perches <joe@perches.com>
Cc: netdev@vger.kernel.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] USB: remove dbg() usage in USB networking drivers
Date: Thu, 20 Sep 2012 11:30:23 +0100 [thread overview]
Message-ID: <20120920103023.GA2012@kroah.com> (raw)
In-Reply-To: <1348135633.5604.5.camel@joe2Laptop>
On Thu, Sep 20, 2012 at 03:07:13AM -0700, Joe Perches wrote:
> On Wed, 2012-09-19 at 20:46 +0100, Greg Kroah-Hartman wrote:
> > The dbg() USB macro is so old, it predates me. The USB networking drivers are
> > the last hold-out using this macro, and we want to get rid of it, so replace
> > the usage of it with the proper netdev_dbg() or dev_dbg() (depending on the
> > context) calls.
>
> OK, one more bit of trivia
>
> > diff --git a/drivers/net/usb/net1080.c b/drivers/net/usb/net1080.c
> []
> > @@ -422,8 +419,9 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
> > if (!(skb->len & 0x01)) {
> > #ifdef DEBUG
> > struct net_device *net = dev->net;
> > - dbg("rx framesize %d range %d..%d mtu %d", skb->len,
> > - net->hard_header_len, dev->hard_mtu, net->mtu);
> > + netdev_dbg(dev->net, "rx framesize %d range %d..%d mtu %d\n",
> > + skb->len, net->hard_header_len, dev->hard_mtu,
> > + net->mtu);
> > #endif
>
> maybe
> netdev_dbg(net, ...
>
> or remove the odd #ifdef DEBUG surround used to guard
> the otherwise unused net variable and use:
>
> netdev_dbg(dev->net, "rx framesize %d range %d..%d mtu %d\n",
> skb->len, dev->net->hard_header_len, dev->hard_mtu,
> dev->net->mtu);
>
Yeah, that would be better.
Even better would be just to delete all of this debug crud from these
drivers. Almost all of the messages are there from when the developer
originally wrote the driver, trying to figure out what was going on.
>From what I have seen, in doing all of these cleanups, is that the need
for maybe a few debug lines that can be used if users have issues, but
the majority are just useless.
But, as I'm not the author or maintainer of these drivers, I'll be nice
and just leave them in, all I want to do is get rid of the old, foolish,
macros for debugging and use the proper dynamic debug code that works so
much better.
So I'll leave this change alone, and if someone wants to do the cleanup
better, the 3 liner above is fine with me to add later.
thanks,
greg k-h
next prev parent reply other threads:[~2012-09-20 10:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-19 17:13 [PATCH] USB: remove dbg() usage in USB networking drivers Greg Kroah-Hartman
2012-09-19 17:53 ` Joe Perches
2012-09-19 19:35 ` Greg Kroah-Hartman
2012-09-19 19:46 ` [PATCH v2] " Greg Kroah-Hartman
2012-09-20 10:07 ` Joe Perches
2012-09-20 10:30 ` Greg Kroah-Hartman [this message]
2012-09-20 21:53 ` David Miller
2012-09-21 0:10 ` [PATCH net-next] net1080: Neaten netdev_dbg use Joe Perches
2012-09-21 2:06 ` David Miller
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=20120920103023.GA2012@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--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).