chelsio: Use netdev_<level> and pr_<level>
Subsystems (5)
Networking Network drivers CXGB4 Ethernet driver (CXGB4) CXGB4VF Ethernet driver (CXGB4VF) +1 more subsystems
PATCH 1/1 chelsio: Use netdev_<level> and pr_<level>
Use more current logging styles.
Convert printks to pr_<level> and
printks with ("%s: ...", dev->name to netdev_<level>(dev, "...
Add pr_fmt #defines where appropriate.
Coalesce formats.
Use pr_<level>_once where appropriate.
Signed-off-by Joe Perches <[email protected]>
--- drivers/net/ethernet/chelsio/cxgb/cxgb2.c | 28 +++++------ drivers/net/ethernet/chelsio/cxgb/sge.c | 6 +-- drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 42 ++++++++--------- drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c | 54 ++++++++++------------ drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +- .../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 23 ++++----- 6 files changed, 66 insertions(+), 89 deletions(-)
drivers/net/ethernet/chelsio/cxgb/cxgb2.c +11 -17
@@ -131,7 +131,7 @@ static void t1_set_rxmode(struct net_device *dev)static void link_report (struct port_info *p) {if (!netif_carrier_ok (p->dev)) -printk (KERN_INFO "%s: link down\n" , p->dev->name); +netdev_info (p->dev,"link down\n" );else {const char *s ="10Mbps" ;
@@ -141,9 +141,9 @@ static void link_report(struct port_info *p)case SPEED_100 : s ="100Mbps" ;break ; } -printk (KERN_INFO "%s: link up, %s, %s-duplex\n" , - p->dev->name, s, - p->link_config.duplex ==DUPLEX_FULL ?"full" :"half" ); +netdev_info (p->dev,"link up, %s, %s-duplex\n" , + s, p->link_config.duplex ==DUPLEX_FULL + ?"full" :"half" ); } }
@@ -976,19 +976,13 @@ static const struct net_device_ops cxgb_netdev_ops = {static int init_one (struct pci_dev *pdev,const struct pci_device_id *ent) { -static int version_printed; -int i, err, pci_using_dac =0 ;unsigned long mmio_start, mmio_len;const struct board_info *bi;struct adapter *adapter =NULL ;struct port_info *pi; -if (!version_printed) { -printk (KERN_INFO "%s - version %s\n" ,DRV_DESCRIPTION , -DRV_VERSION ); - ++version_printed; - } +pr_info_once ("%s - version %s\n" ,DRV_DESCRIPTION ,DRV_VERSION ); err =pci_enable_device (pdev);if (err)
@@ -1124,8 +1118,8 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)for (i =0 ; i < bi->port_number; ++i) { err =register_netdev (adapter->port[i].dev);if (err) -pr_warning ("%s: cannot register net device %s, skipping\n" , -pci_name (pdev), adapter->port[i].dev->name); +pr_warn ("%s: cannot register net device %s, skipping\n" , +pci_name (pdev), adapter->port[i].dev->name);else {/* * Change the name we use for messages to the name of
@@ -1143,10 +1137,10 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) goto out_release_adapter_res; } -printk (KERN_INFO "%s: %s (rev %d), %s %dMHz/%d-bit\n" , adapter->name, - bi->desc, adapter->params.chip_revision, - adapter->params.pci.is_pcix ?"PCIX" :"PCI" , - adapter->params.pci.speed, adapter->params.pci.width); +pr_info ("%s: %s (rev %d), %s %dMHz/%d-bit\n" , + adapter->name, bi->desc, adapter->params.chip_revision, + adapter->params.pci.is_pcix ?"PCIX" :"PCI" , + adapter->params.pci.speed, adapter->params.pci.width);/* * Set the T1B ASIC and memory clocks.
drivers/net/ethernet/chelsio/cxgb/sge.c +3 -3
@@ -1822,8 +1822,8 @@ netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev)*/ if (unlikely (skb->len <ETH_HLEN || skb->len > dev->mtu +eth_hdr_len (skb->data))) { -pr_debug ("%s: packet size %d hdr %d mtu%d\n" , dev->name, - skb->len,eth_hdr_len (skb->data), dev->mtu); +netdev_dbg (dev,"packet size %d hdr %d mtu%d\n" , + skb->len,eth_hdr_len (skb->data), dev->mtu);dev_kfree_skb_any (skb);return NETDEV_TX_OK ; }
@@ -1831,7 +1831,7 @@ netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev)if (skb->ip_summed ==CHECKSUM_PARTIAL &&ip_hdr (skb)->protocol ==IPPROTO_UDP ) {if (unlikely (skb_checksum_help (skb))) { -pr_debug ("%s: unable to do udp checksum\n" , dev->name); +netdev_dbg (dev,"unable to do udp checksum\n" );dev_kfree_skb_any (skb);return NETDEV_TX_OK ; }
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +19 -23
96 lines not on this page · raw message
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c +24 -30
167 lines not on this page · raw message
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +1 -1
@@ -5131,7 +5131,7 @@ static int __init cxgb4_init_module(void)/* Debugfs support is optional, just warn if this fails */ cxgb4_debugfs_root =debugfs_create_dir (KBUILD_MODNAME ,NULL );if (!cxgb4_debugfs_root) -pr_warning ("could not create debugfs entry, continuing\n" ); +pr_warn ("could not create debugfs entry, continuing\n" ); ret =pci_register_driver (&cxgb4_driver);if (ret <0 )
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +8 -15
@@ -33,6 +33,8 @@* SOFTWARE. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h>
@@ -196,11 +198,10 @@ void t4vf_os_link_changed(struct adapter *adapter, int pidx, int link_ok)break ; } -printk (KERN_INFO "%s: link up, %s, full-duplex, %s PAUSE\n" , - dev->name, s, fc); +netdev_info (dev,"link up, %s, full-duplex, %s PAUSE\n" , s, fc); }else {netif_carrier_off (dev); -printk (KERN_INFO "%s: link down\n" , dev->name); +netdev_info (dev,"link down\n" ); } }
@@ -2465,8 +2466,6 @@ static const struct net_device_ops cxgb4vf_netdev_ops = {static int cxgb4vf_pci_probe (struct pci_dev *pdev,const struct pci_device_id *ent) { -static int version_printed; -int pci_using_dac;int err, pidx;unsigned int pmask;
@@ -2478,10 +2477,7 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev,* Print our driver banner the first time we're called to initialize a * device. */ -if (version_printed ==0 ) { -printk (KERN_INFO "%s - version %s\n" ,DRV_DESC ,DRV_VERSION ); - version_printed =1 ; - } +pr_info_once ("%s - version %s\n" ,DRV_DESC ,DRV_VERSION );/* * Initialize generic PCI device state.
@@ -2920,18 +2916,15 @@ static int __init cxgb4vf_module_init(void)* Vet our module parameters. */ if (msi !=MSI_MSIX && msi !=MSI_MSI ) { - printk(KERN_WARNING KBUILD_MODNAME -": bad module parameter msi=%d; must be %d" -" (MSI-X or MSI) or %d (MSI)\n" , - msi, MSI_MSIX, MSI_MSI); +pr_warn ("bad module parameter msi=%d; must be %d (MSI-X or MSI) or %d (MSI)\n" , + msi,MSI_MSIX ,MSI_MSI );return -EINVAL ; }/* Debugfs support is optional, just warn if this fails */ cxgb4vf_debugfs_root =debugfs_create_dir (KBUILD_MODNAME ,NULL );if (IS_ERR_OR_NULL (cxgb4vf_debugfs_root)) - printk(KERN_WARNING KBUILD_MODNAME ": could not create" -" debugfs entry, continuing\n" ); +pr_warn ("could not create debugfs entry, continuing\n" ); ret =pci_register_driver (&cxgb4vf_driver);if (ret <0 && !IS_ERR_OR_NULL (cxgb4vf_debugfs_root))
From: Joe Perches <[email protected]>
Date: Sun, 06 Jan 2013 15:34:49 -0800
Quoted 10 lines
Use more current logging styles.
Convert printks to pr_<level> and
printks with ("%s: ...",dev->nameto netdev_<level>(dev, "...Add
pr_fmt#defines where appropriate.
Coalesce formats.
Use pr_<level>_once where appropriate.Signed-off-by Joe Perches <[email protected]>
Applied.