Commit 428ac43f authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 483f7772
...@@ -131,7 +131,7 @@ static void t1_set_rxmode(struct net_device *dev) ...@@ -131,7 +131,7 @@ static void t1_set_rxmode(struct net_device *dev)
static void link_report(struct port_info *p) static void link_report(struct port_info *p)
{ {
if (!netif_carrier_ok(p->dev)) if (!netif_carrier_ok(p->dev))
printk(KERN_INFO "%s: link down\n", p->dev->name); netdev_info(p->dev, "link down\n");
else { else {
const char *s = "10Mbps"; const char *s = "10Mbps";
...@@ -141,9 +141,9 @@ static void link_report(struct port_info *p) ...@@ -141,9 +141,9 @@ static void link_report(struct port_info *p)
case SPEED_100: s = "100Mbps"; break; case SPEED_100: s = "100Mbps"; break;
} }
printk(KERN_INFO "%s: link up, %s, %s-duplex\n", netdev_info(p->dev, "link up, %s, %s-duplex\n",
p->dev->name, s, s, p->link_config.duplex == DUPLEX_FULL
p->link_config.duplex == DUPLEX_FULL ? "full" : "half"); ? "full" : "half");
} }
} }
...@@ -976,19 +976,13 @@ static const struct net_device_ops cxgb_netdev_ops = { ...@@ -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 init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int version_printed;
int i, err, pci_using_dac = 0; int i, err, pci_using_dac = 0;
unsigned long mmio_start, mmio_len; unsigned long mmio_start, mmio_len;
const struct board_info *bi; const struct board_info *bi;
struct adapter *adapter = NULL; struct adapter *adapter = NULL;
struct port_info *pi; struct port_info *pi;
if (!version_printed) { pr_info_once("%s - version %s\n", DRV_DESCRIPTION, DRV_VERSION);
printk(KERN_INFO "%s - version %s\n", DRV_DESCRIPTION,
DRV_VERSION);
++version_printed;
}
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) if (err)
...@@ -1124,8 +1118,8 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -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) { for (i = 0; i < bi->port_number; ++i) {
err = register_netdev(adapter->port[i].dev); err = register_netdev(adapter->port[i].dev);
if (err) if (err)
pr_warning("%s: cannot register net device %s, skipping\n", pr_warn("%s: cannot register net device %s, skipping\n",
pci_name(pdev), adapter->port[i].dev->name); pci_name(pdev), adapter->port[i].dev->name);
else { else {
/* /*
* Change the name we use for messages to the name of * 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) ...@@ -1143,10 +1137,10 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
goto out_release_adapter_res; goto out_release_adapter_res;
} }
printk(KERN_INFO "%s: %s (rev %d), %s %dMHz/%d-bit\n", adapter->name, pr_info("%s: %s (rev %d), %s %dMHz/%d-bit\n",
bi->desc, adapter->params.chip_revision, adapter->name, bi->desc, adapter->params.chip_revision,
adapter->params.pci.is_pcix ? "PCIX" : "PCI", adapter->params.pci.is_pcix ? "PCIX" : "PCI",
adapter->params.pci.speed, adapter->params.pci.width); adapter->params.pci.speed, adapter->params.pci.width);
/* /*
* Set the T1B ASIC and memory clocks. * Set the T1B ASIC and memory clocks.
......
...@@ -1822,8 +1822,8 @@ netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1822,8 +1822,8 @@ netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
*/ */
if (unlikely(skb->len < ETH_HLEN || if (unlikely(skb->len < ETH_HLEN ||
skb->len > dev->mtu + eth_hdr_len(skb->data))) { skb->len > dev->mtu + eth_hdr_len(skb->data))) {
pr_debug("%s: packet size %d hdr %d mtu%d\n", dev->name, netdev_dbg(dev, "packet size %d hdr %d mtu%d\n",
skb->len, eth_hdr_len(skb->data), dev->mtu); skb->len, eth_hdr_len(skb->data), dev->mtu);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
...@@ -1831,7 +1831,7 @@ netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1831,7 +1831,7 @@ netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (skb->ip_summed == CHECKSUM_PARTIAL && if (skb->ip_summed == CHECKSUM_PARTIAL &&
ip_hdr(skb)->protocol == IPPROTO_UDP) { ip_hdr(skb)->protocol == IPPROTO_UDP) {
if (unlikely(skb_checksum_help(skb))) { 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); dev_kfree_skb_any(skb);
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
......
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -153,7 +156,7 @@ struct workqueue_struct *cxgb3_wq; ...@@ -153,7 +156,7 @@ struct workqueue_struct *cxgb3_wq;
static void link_report(struct net_device *dev) static void link_report(struct net_device *dev)
{ {
if (!netif_carrier_ok(dev)) if (!netif_carrier_ok(dev))
printk(KERN_INFO "%s: link down\n", dev->name); netdev_info(dev, "link down\n");
else { else {
const char *s = "10Mbps"; const char *s = "10Mbps";
const struct port_info *p = netdev_priv(dev); const struct port_info *p = netdev_priv(dev);
...@@ -170,8 +173,9 @@ static void link_report(struct net_device *dev) ...@@ -170,8 +173,9 @@ static void link_report(struct net_device *dev)
break; break;
} }
printk(KERN_INFO "%s: link up, %s, %s-duplex\n", dev->name, s, netdev_info(dev, "link up, %s, %s-duplex\n",
p->link_config.duplex == DUPLEX_FULL ? "full" : "half"); s, p->link_config.duplex == DUPLEX_FULL
? "full" : "half");
} }
} }
...@@ -318,10 +322,10 @@ void t3_os_phymod_changed(struct adapter *adap, int port_id) ...@@ -318,10 +322,10 @@ void t3_os_phymod_changed(struct adapter *adap, int port_id)
const struct port_info *pi = netdev_priv(dev); const struct port_info *pi = netdev_priv(dev);
if (pi->phy.modtype == phy_modtype_none) if (pi->phy.modtype == phy_modtype_none)
printk(KERN_INFO "%s: PHY module unplugged\n", dev->name); netdev_info(dev, "PHY module unplugged\n");
else else
printk(KERN_INFO "%s: %s PHY module inserted\n", dev->name, netdev_info(dev, "%s PHY module inserted\n",
mod_str[pi->phy.modtype]); mod_str[pi->phy.modtype]);
} }
static void cxgb_set_rxmode(struct net_device *dev) static void cxgb_set_rxmode(struct net_device *dev)
...@@ -1422,8 +1426,7 @@ static int cxgb_open(struct net_device *dev) ...@@ -1422,8 +1426,7 @@ static int cxgb_open(struct net_device *dev)
if (is_offload(adapter) && !ofld_disable) { if (is_offload(adapter) && !ofld_disable) {
err = offload_open(dev); err = offload_open(dev);
if (err) if (err)
printk(KERN_WARNING pr_warn("Could not initialize offload capabilities\n");
"Could not initialize offload capabilities\n");
} }
netif_set_real_num_tx_queues(dev, pi->nqsets); netif_set_real_num_tx_queues(dev, pi->nqsets);
...@@ -3132,14 +3135,13 @@ static void print_port_info(struct adapter *adap, const struct adapter_info *ai) ...@@ -3132,14 +3135,13 @@ static void print_port_info(struct adapter *adap, const struct adapter_info *ai)
if (!test_bit(i, &adap->registered_device_map)) if (!test_bit(i, &adap->registered_device_map))
continue; continue;
printk(KERN_INFO "%s: %s %s %sNIC (rev %d) %s%s\n", netdev_info(dev, "%s %s %sNIC (rev %d) %s%s\n",
dev->name, ai->desc, pi->phy.desc, ai->desc, pi->phy.desc,
is_offload(adap) ? "R" : "", adap->params.rev, buf, is_offload(adap) ? "R" : "", adap->params.rev, buf,
(adap->flags & USING_MSIX) ? " MSI-X" : (adap->flags & USING_MSIX) ? " MSI-X" :
(adap->flags & USING_MSI) ? " MSI" : ""); (adap->flags & USING_MSI) ? " MSI" : "");
if (adap->name == dev->name && adap->params.vpd.mclk) if (adap->name == dev->name && adap->params.vpd.mclk)
printk(KERN_INFO pr_info("%s: %uMB CM, %uMB PMTX, %uMB PMRX, S/N: %s\n",
"%s: %uMB CM, %uMB PMTX, %uMB PMRX, S/N: %s\n",
adap->name, t3_mc7_size(&adap->cm) >> 20, adap->name, t3_mc7_size(&adap->cm) >> 20,
t3_mc7_size(&adap->pmtx) >> 20, t3_mc7_size(&adap->pmtx) >> 20,
t3_mc7_size(&adap->pmrx) >> 20, t3_mc7_size(&adap->pmrx) >> 20,
...@@ -3177,24 +3179,18 @@ static void cxgb3_init_iscsi_mac(struct net_device *dev) ...@@ -3177,24 +3179,18 @@ static void cxgb3_init_iscsi_mac(struct net_device *dev)
NETIF_F_IPV6_CSUM | NETIF_F_HIGHDMA) NETIF_F_IPV6_CSUM | NETIF_F_HIGHDMA)
static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 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; int i, err, pci_using_dac = 0;
resource_size_t mmio_start, mmio_len; resource_size_t mmio_start, mmio_len;
const struct adapter_info *ai; const struct adapter_info *ai;
struct adapter *adapter = NULL; struct adapter *adapter = NULL;
struct port_info *pi; struct port_info *pi;
if (!version_printed) { pr_info_once("%s - version %s\n", DRV_DESC, DRV_VERSION);
printk(KERN_INFO "%s - version %s\n", DRV_DESC, DRV_VERSION);
++version_printed;
}
if (!cxgb3_wq) { if (!cxgb3_wq) {
cxgb3_wq = create_singlethread_workqueue(DRV_NAME); cxgb3_wq = create_singlethread_workqueue(DRV_NAME);
if (!cxgb3_wq) { if (!cxgb3_wq) {
printk(KERN_ERR DRV_NAME pr_err("cannot initialize work queue\n");
": cannot initialize work queue\n");
return -ENOMEM; return -ENOMEM;
} }
} }
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
* SOFTWARE. * SOFTWARE.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/list.h> #include <linux/list.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <net/neighbour.h> #include <net/neighbour.h>
...@@ -235,8 +237,7 @@ static int cxgb_ulp_iscsi_ctl(struct adapter *adapter, unsigned int req, ...@@ -235,8 +237,7 @@ static int cxgb_ulp_iscsi_ctl(struct adapter *adapter, unsigned int req,
if ((val >> S_MAXRXDATA) != 0x3f60) { if ((val >> S_MAXRXDATA) != 0x3f60) {
val &= (M_RXCOALESCESIZE << S_RXCOALESCESIZE); val &= (M_RXCOALESCESIZE << S_RXCOALESCESIZE);
val |= V_MAXRXDATA(0x3f60); val |= V_MAXRXDATA(0x3f60);
printk(KERN_INFO pr_info("%s, iscsi set MaxRxData to 16224 (0x%x)\n",
"%s, iscsi set MaxRxData to 16224 (0x%x).\n",
adapter->name, val); adapter->name, val);
t3_write_reg(adapter, A_TP_PARA_REG2, val); t3_write_reg(adapter, A_TP_PARA_REG2, val);
} }
...@@ -256,8 +257,7 @@ static int cxgb_ulp_iscsi_ctl(struct adapter *adapter, unsigned int req, ...@@ -256,8 +257,7 @@ static int cxgb_ulp_iscsi_ctl(struct adapter *adapter, unsigned int req,
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
val |= (uiip->pgsz_factor[i] & 0xF) << (8 * i); val |= (uiip->pgsz_factor[i] & 0xF) << (8 * i);
if (val && (val != t3_read_reg(adapter, A_ULPRX_ISCSI_PSZ))) { if (val && (val != t3_read_reg(adapter, A_ULPRX_ISCSI_PSZ))) {
printk(KERN_INFO pr_info("%s, setting iscsi pgsz 0x%x, %u,%u,%u,%u\n",
"%s, setting iscsi pgsz 0x%x, %u,%u,%u,%u.\n",
adapter->name, val, uiip->pgsz_factor[0], adapter->name, val, uiip->pgsz_factor[0],
uiip->pgsz_factor[1], uiip->pgsz_factor[2], uiip->pgsz_factor[1], uiip->pgsz_factor[2],
uiip->pgsz_factor[3]); uiip->pgsz_factor[3]);
...@@ -709,8 +709,7 @@ static int do_smt_write_rpl(struct t3cdev *dev, struct sk_buff *skb) ...@@ -709,8 +709,7 @@ static int do_smt_write_rpl(struct t3cdev *dev, struct sk_buff *skb)
struct cpl_smt_write_rpl *rpl = cplhdr(skb); struct cpl_smt_write_rpl *rpl = cplhdr(skb);
if (rpl->status != CPL_ERR_NONE) if (rpl->status != CPL_ERR_NONE)
printk(KERN_ERR pr_err("Unexpected SMT_WRITE_RPL status %u for entry %u\n",
"Unexpected SMT_WRITE_RPL status %u for entry %u\n",
rpl->status, GET_TID(rpl)); rpl->status, GET_TID(rpl));
return CPL_RET_BUF_DONE; return CPL_RET_BUF_DONE;
...@@ -721,8 +720,7 @@ static int do_l2t_write_rpl(struct t3cdev *dev, struct sk_buff *skb) ...@@ -721,8 +720,7 @@ static int do_l2t_write_rpl(struct t3cdev *dev, struct sk_buff *skb)
struct cpl_l2t_write_rpl *rpl = cplhdr(skb); struct cpl_l2t_write_rpl *rpl = cplhdr(skb);
if (rpl->status != CPL_ERR_NONE) if (rpl->status != CPL_ERR_NONE)
printk(KERN_ERR pr_err("Unexpected L2T_WRITE_RPL status %u for entry %u\n",
"Unexpected L2T_WRITE_RPL status %u for entry %u\n",
rpl->status, GET_TID(rpl)); rpl->status, GET_TID(rpl));
return CPL_RET_BUF_DONE; return CPL_RET_BUF_DONE;
...@@ -733,8 +731,7 @@ static int do_rte_write_rpl(struct t3cdev *dev, struct sk_buff *skb) ...@@ -733,8 +731,7 @@ static int do_rte_write_rpl(struct t3cdev *dev, struct sk_buff *skb)
struct cpl_rte_write_rpl *rpl = cplhdr(skb); struct cpl_rte_write_rpl *rpl = cplhdr(skb);
if (rpl->status != CPL_ERR_NONE) if (rpl->status != CPL_ERR_NONE)
printk(KERN_ERR pr_err("Unexpected RTE_WRITE_RPL status %u for entry %u\n",
"Unexpected RTE_WRITE_RPL status %u for entry %u\n",
rpl->status, GET_TID(rpl)); rpl->status, GET_TID(rpl));
return CPL_RET_BUF_DONE; return CPL_RET_BUF_DONE;
...@@ -754,7 +751,7 @@ static int do_act_open_rpl(struct t3cdev *dev, struct sk_buff *skb) ...@@ -754,7 +751,7 @@ static int do_act_open_rpl(struct t3cdev *dev, struct sk_buff *skb)
t3c_tid-> t3c_tid->
ctx); ctx);
} else { } else {
printk(KERN_ERR "%s: received clientless CPL command 0x%x\n", pr_err("%s: received clientless CPL command 0x%x\n",
dev->name, CPL_ACT_OPEN_RPL); dev->name, CPL_ACT_OPEN_RPL);
return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG; return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG;
} }
...@@ -772,7 +769,7 @@ static int do_stid_rpl(struct t3cdev *dev, struct sk_buff *skb) ...@@ -772,7 +769,7 @@ static int do_stid_rpl(struct t3cdev *dev, struct sk_buff *skb)
return t3c_tid->client->handlers[p->opcode] (dev, skb, return t3c_tid->client->handlers[p->opcode] (dev, skb,
t3c_tid->ctx); t3c_tid->ctx);
} else { } else {
printk(KERN_ERR "%s: received clientless CPL command 0x%x\n", pr_err("%s: received clientless CPL command 0x%x\n",
dev->name, p->opcode); dev->name, p->opcode);
return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG; return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG;
} }
...@@ -790,7 +787,7 @@ static int do_hwtid_rpl(struct t3cdev *dev, struct sk_buff *skb) ...@@ -790,7 +787,7 @@ static int do_hwtid_rpl(struct t3cdev *dev, struct sk_buff *skb)
return t3c_tid->client->handlers[p->opcode] return t3c_tid->client->handlers[p->opcode]
(dev, skb, t3c_tid->ctx); (dev, skb, t3c_tid->ctx);
} else { } else {
printk(KERN_ERR "%s: received clientless CPL command 0x%x\n", pr_err("%s: received clientless CPL command 0x%x\n",
dev->name, p->opcode); dev->name, p->opcode);
return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG; return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG;
} }
...@@ -817,7 +814,7 @@ static int do_cr(struct t3cdev *dev, struct sk_buff *skb) ...@@ -817,7 +814,7 @@ static int do_cr(struct t3cdev *dev, struct sk_buff *skb)
return t3c_tid->client->handlers[CPL_PASS_ACCEPT_REQ] return t3c_tid->client->handlers[CPL_PASS_ACCEPT_REQ]
(dev, skb, t3c_tid->ctx); (dev, skb, t3c_tid->ctx);
} else { } else {
printk(KERN_ERR "%s: received clientless CPL command 0x%x\n", pr_err("%s: received clientless CPL command 0x%x\n",
dev->name, CPL_PASS_ACCEPT_REQ); dev->name, CPL_PASS_ACCEPT_REQ);
return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG; return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG;
} }
...@@ -911,7 +908,7 @@ static int do_act_establish(struct t3cdev *dev, struct sk_buff *skb) ...@@ -911,7 +908,7 @@ static int do_act_establish(struct t3cdev *dev, struct sk_buff *skb)
return t3c_tid->client->handlers[CPL_ACT_ESTABLISH] return t3c_tid->client->handlers[CPL_ACT_ESTABLISH]
(dev, skb, t3c_tid->ctx); (dev, skb, t3c_tid->ctx);
} else { } else {
printk(KERN_ERR "%s: received clientless CPL command 0x%x\n", pr_err("%s: received clientless CPL command 0x%x\n",
dev->name, CPL_ACT_ESTABLISH); dev->name, CPL_ACT_ESTABLISH);
return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG; return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG;
} }
...@@ -957,7 +954,7 @@ static int do_term(struct t3cdev *dev, struct sk_buff *skb) ...@@ -957,7 +954,7 @@ static int do_term(struct t3cdev *dev, struct sk_buff *skb)
return t3c_tid->client->handlers[opcode] (dev, skb, return t3c_tid->client->handlers[opcode] (dev, skb,
t3c_tid->ctx); t3c_tid->ctx);
} else { } else {
printk(KERN_ERR "%s: received clientless CPL command 0x%x\n", pr_err("%s: received clientless CPL command 0x%x\n",
dev->name, opcode); dev->name, opcode);
return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG; return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG;
} }
...@@ -994,8 +991,7 @@ static struct notifier_block nb = { ...@@ -994,8 +991,7 @@ static struct notifier_block nb = {
*/ */
static int do_bad_cpl(struct t3cdev *dev, struct sk_buff *skb) static int do_bad_cpl(struct t3cdev *dev, struct sk_buff *skb)
{ {
printk(KERN_ERR "%s: received bad CPL command 0x%x\n", dev->name, pr_err("%s: received bad CPL command 0x%x\n", dev->name, *skb->data);
*skb->data);
return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG; return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG;
} }
...@@ -1013,8 +1009,8 @@ void t3_register_cpl_handler(unsigned int opcode, cpl_handler_func h) ...@@ -1013,8 +1009,8 @@ void t3_register_cpl_handler(unsigned int opcode, cpl_handler_func h)
if (opcode < NUM_CPL_CMDS) if (opcode < NUM_CPL_CMDS)
cpl_handlers[opcode] = h ? h : do_bad_cpl; cpl_handlers[opcode] = h ? h : do_bad_cpl;
else else
printk(KERN_ERR "T3C: handler registration for " pr_err("T3C: handler registration for opcode %x failed\n",
"opcode %x failed\n", opcode); opcode);
} }
EXPORT_SYMBOL(t3_register_cpl_handler); EXPORT_SYMBOL(t3_register_cpl_handler);
...@@ -1033,9 +1029,8 @@ static int process_rx(struct t3cdev *dev, struct sk_buff **skbs, int n) ...@@ -1033,9 +1029,8 @@ static int process_rx(struct t3cdev *dev, struct sk_buff **skbs, int n)
if (ret & CPL_RET_UNKNOWN_TID) { if (ret & CPL_RET_UNKNOWN_TID) {
union opcode_tid *p = cplhdr(skb); union opcode_tid *p = cplhdr(skb);
printk(KERN_ERR "%s: CPL message (opcode %u) had " pr_err("%s: CPL message (opcode %u) had unknown TID %u\n",
"unknown TID %u\n", dev->name, opcode, dev->name, opcode, G_TID(ntohl(p->opcode_tid)));
G_TID(ntohl(p->opcode_tid)));
} }
#endif #endif
if (ret & CPL_RET_BUF_DONE) if (ret & CPL_RET_BUF_DONE)
...@@ -1099,7 +1094,7 @@ static void set_l2t_ix(struct t3cdev *tdev, u32 tid, struct l2t_entry *e) ...@@ -1099,7 +1094,7 @@ static void set_l2t_ix(struct t3cdev *tdev, u32 tid, struct l2t_entry *e)
skb = alloc_skb(sizeof(*req), GFP_ATOMIC); skb = alloc_skb(sizeof(*req), GFP_ATOMIC);
if (!skb) { if (!skb) {
printk(KERN_ERR "%s: cannot allocate skb!\n", __func__); pr_err("%s: cannot allocate skb!\n", __func__);
return; return;
} }
skb->priority = CPL_PRIORITY_CONTROL; skb->priority = CPL_PRIORITY_CONTROL;
...@@ -1132,23 +1127,22 @@ static void cxgb_redirect(struct dst_entry *old, struct neighbour *old_neigh, ...@@ -1132,23 +1127,22 @@ static void cxgb_redirect(struct dst_entry *old, struct neighbour *old_neigh,
if (!is_offloading(olddev)) if (!is_offloading(olddev))
return; return;
if (!is_offloading(newdev)) { if (!is_offloading(newdev)) {
printk(KERN_WARNING "%s: Redirect to non-offload " pr_warn("%s: Redirect to non-offload device ignored\n",
"device ignored.\n", __func__); __func__);
return; return;
} }
tdev = dev2t3cdev(olddev); tdev = dev2t3cdev(olddev);
BUG_ON(!tdev); BUG_ON(!tdev);
if (tdev != dev2t3cdev(newdev)) { if (tdev != dev2t3cdev(newdev)) {
printk(KERN_WARNING "%s: Redirect to different " pr_warn("%s: Redirect to different offload device ignored\n",
"offload device ignored.\n", __func__); __func__);
return; return;
} }
/* Add new L2T entry */ /* Add new L2T entry */
e = t3_l2t_get(tdev, new, newdev, daddr); e = t3_l2t_get(tdev, new, newdev, daddr);
if (!e) { if (!e) {
printk(KERN_ERR "%s: couldn't allocate new l2t entry!\n", pr_err("%s: couldn't allocate new l2t entry!\n", __func__);
__func__);
return; return;
} }
......
...@@ -5131,7 +5131,7 @@ static int __init cxgb4_init_module(void) ...@@ -5131,7 +5131,7 @@ static int __init cxgb4_init_module(void)
/* Debugfs support is optional, just warn if this fails */ /* Debugfs support is optional, just warn if this fails */
cxgb4_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL); cxgb4_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
if (!cxgb4_debugfs_root) 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); ret = pci_register_driver(&cxgb4_driver);
if (ret < 0) if (ret < 0)
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
* SOFTWARE. * SOFTWARE.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -196,11 +198,10 @@ void t4vf_os_link_changed(struct adapter *adapter, int pidx, int link_ok) ...@@ -196,11 +198,10 @@ void t4vf_os_link_changed(struct adapter *adapter, int pidx, int link_ok)
break; break;
} }
printk(KERN_INFO "%s: link up, %s, full-duplex, %s PAUSE\n", netdev_info(dev, "link up, %s, full-duplex, %s PAUSE\n", s, fc);
dev->name, s, fc);
} else { } else {
netif_carrier_off(dev); 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 = { ...@@ -2465,8 +2466,6 @@ static const struct net_device_ops cxgb4vf_netdev_ops = {
static int cxgb4vf_pci_probe(struct pci_dev *pdev, static int cxgb4vf_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
static int version_printed;
int pci_using_dac; int pci_using_dac;
int err, pidx; int err, pidx;
unsigned int pmask; unsigned int pmask;
...@@ -2478,10 +2477,7 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev, ...@@ -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 * Print our driver banner the first time we're called to initialize a
* device. * device.
*/ */
if (version_printed == 0) { pr_info_once("%s - version %s\n", DRV_DESC, DRV_VERSION);
printk(KERN_INFO "%s - version %s\n", DRV_DESC, DRV_VERSION);
version_printed = 1;
}
/* /*
* Initialize generic PCI device state. * Initialize generic PCI device state.
...@@ -2920,18 +2916,15 @@ static int __init cxgb4vf_module_init(void) ...@@ -2920,18 +2916,15 @@ static int __init cxgb4vf_module_init(void)
* Vet our module parameters. * Vet our module parameters.
*/ */
if (msi != MSI_MSIX && msi != MSI_MSI) { if (msi != MSI_MSIX && msi != MSI_MSI) {
printk(KERN_WARNING KBUILD_MODNAME pr_warn("bad module parameter msi=%d; must be %d (MSI-X or MSI) or %d (MSI)\n",
": bad module parameter msi=%d; must be %d" msi, MSI_MSIX, MSI_MSI);
" (MSI-X or MSI) or %d (MSI)\n",
msi, MSI_MSIX, MSI_MSI);
return -EINVAL; return -EINVAL;
} }
/* Debugfs support is optional, just warn if this fails */ /* Debugfs support is optional, just warn if this fails */
cxgb4vf_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL); cxgb4vf_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
if (IS_ERR_OR_NULL(cxgb4vf_debugfs_root)) if (IS_ERR_OR_NULL(cxgb4vf_debugfs_root))
printk(KERN_WARNING KBUILD_MODNAME ": could not create" pr_warn("could not create debugfs entry, continuing\n");
" debugfs entry, continuing\n");
ret = pci_register_driver(&cxgb4vf_driver); ret = pci_register_driver(&cxgb4vf_driver);
if (ret < 0 && !IS_ERR_OR_NULL(cxgb4vf_debugfs_root)) if (ret < 0 && !IS_ERR_OR_NULL(cxgb4vf_debugfs_root))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment