Patchwork [20/21] ntb_netdev: improve logging

login
register
mail settings
Submitter Jon Mason
Date Jan. 19, 2013, 9:02 a.m.
Message ID <1358586155-23322-21-git-send-email-jon.mason@intel.com>
Download mbox | patch
Permalink /patch/213786/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Jon Mason - Jan. 19, 2013, 9:02 a.m.
Improve driver logging to be more helpful

Signed-off-by: Jon Mason <jon.mason@intel.com>
---
 drivers/net/ntb_netdev.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Joe Perches - Jan. 19, 2013, 6:51 p.m.
On Sat, 2013-01-19 at 02:02 -0700, Jon Mason wrote:
> Improve driver logging to be more helpful
[]
> diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c
[]
> @@ -408,6 +408,5 @@ static void __exit ntb_netdev_exit_module(void)
>  {
>  	ntb_unregister_client(&ntb_netdev_client);
>  	ntb_unregister_client_dev(KBUILD_MODNAME);
> -	pr_info("%s: Driver removed\n", KBUILD_MODNAME);

It's almost always true that using
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
before any #include

and changing all pr_<level>( uses from

	pr_<level>("s: etc...", KBUiLD_MODNAME, ...)
to
	pr_<level>("etc...", ...)

produces overall smaller object code.
That's even more likely for 64 bit compiled code.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c
index 37173ce..02213a8 100644
--- a/drivers/net/ntb_netdev.c
+++ b/drivers/net/ntb_netdev.c
@@ -153,7 +153,7 @@  static netdev_tx_t ntb_netdev_start_xmit(struct sk_buff *skb,
 	struct ntb_netdev *dev = netdev_priv(ndev);
 	int rc;
 
-	netdev_dbg(ndev, "ntb_transport_tx_enqueue\n");
+	netdev_dbg(ndev, "%s: skb len %d\n", __func__, skb->len);
 
 	rc = ntb_transport_tx_enqueue(dev->qp, skb, skb->data, skb->len);
 	if (rc)
@@ -355,7 +355,7 @@  static int ntb_netdev_probe(struct pci_dev *pdev)
 		goto err1;
 
 	list_add(&dev->list, &dev_list);
-	pr_info("%s: %s created\n", KBUILD_MODNAME, ndev->name);
+	dev_info(&pdev->dev, "%s created\n", ndev->name);
 	return 0;
 
 err1:
@@ -408,6 +408,5 @@  static void __exit ntb_netdev_exit_module(void)
 {
 	ntb_unregister_client(&ntb_netdev_client);
 	ntb_unregister_client_dev(KBUILD_MODNAME);
-	pr_info("%s: Driver removed\n", KBUILD_MODNAME);
 }
 module_exit(ntb_netdev_exit_module);