aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-02-01 05:54:43 -0500
committerDavid S. Miller <davem@davemloft.net>2012-02-01 15:57:08 -0500
commit7b6cd1ce72176e21be15a0ac153bdaa5be1b208a (patch)
treee287ae3b6648b72b9204ba0b5703259fdc8d8b7b /net/core
parentc3ca881f0a6e6421f167d3938f4b1e1d008cb505 (diff)
PATCH V2 net-next] net: dev: Convert printks to pr_<level>
Use the current logging style. Coalesce formats where appropriate. Update grammar where appropriate. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c94
1 files changed, 39 insertions, 55 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 115dee1d985d..f1249472e90e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -446,7 +446,7 @@ void __dev_remove_pack(struct packet_type *pt)
446 } 446 }
447 } 447 }
448 448
449 printk(KERN_WARNING "dev_remove_pack: %p not found.\n", pt); 449 pr_warn("dev_remove_pack: %p not found\n", pt);
450out: 450out:
451 spin_unlock(&ptype_lock); 451 spin_unlock(&ptype_lock);
452} 452}
@@ -1039,8 +1039,7 @@ rollback:
1039 memcpy(dev->name, oldname, IFNAMSIZ); 1039 memcpy(dev->name, oldname, IFNAMSIZ);
1040 goto rollback; 1040 goto rollback;
1041 } else { 1041 } else {
1042 printk(KERN_ERR 1042 pr_err("%s: name change rollback failed: %d\n",
1043 "%s: name change rollback failed: %d.\n",
1044 dev->name, ret); 1043 dev->name, ret);
1045 } 1044 }
1046 } 1045 }
@@ -1139,9 +1138,8 @@ void dev_load(struct net *net, const char *name)
1139 no_module = request_module("netdev-%s", name); 1138 no_module = request_module("netdev-%s", name);
1140 if (no_module && capable(CAP_SYS_MODULE)) { 1139 if (no_module && capable(CAP_SYS_MODULE)) {
1141 if (!request_module("%s", name)) 1140 if (!request_module("%s", name))
1142 pr_err("Loading kernel module for a network device " 1141 pr_err("Loading kernel module for a network device with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s instead.\n",
1143"with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s " 1142 name);
1144"instead\n", name);
1145 } 1143 }
1146} 1144}
1147EXPORT_SYMBOL(dev_load); 1145EXPORT_SYMBOL(dev_load);
@@ -1655,10 +1653,9 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
1655 if (skb_network_header(skb2) < skb2->data || 1653 if (skb_network_header(skb2) < skb2->data ||
1656 skb2->network_header > skb2->tail) { 1654 skb2->network_header > skb2->tail) {
1657 if (net_ratelimit()) 1655 if (net_ratelimit())
1658 printk(KERN_CRIT "protocol %04x is " 1656 pr_crit("protocol %04x is buggy, dev %s\n",
1659 "buggy, dev %s\n", 1657 ntohs(skb2->protocol),
1660 ntohs(skb2->protocol), 1658 dev->name);
1661 dev->name);
1662 skb_reset_network_header(skb2); 1659 skb_reset_network_header(skb2);
1663 } 1660 }
1664 1661
@@ -1691,9 +1688,7 @@ static void netif_setup_tc(struct net_device *dev, unsigned int txq)
1691 1688
1692 /* If TC0 is invalidated disable TC mapping */ 1689 /* If TC0 is invalidated disable TC mapping */
1693 if (tc->offset + tc->count > txq) { 1690 if (tc->offset + tc->count > txq) {
1694 pr_warning("Number of in use tx queues changed " 1691 pr_warn("Number of in use tx queues changed invalidating tc mappings. Priority traffic classification disabled!\n");
1695 "invalidating tc mappings. Priority "
1696 "traffic classification disabled!\n");
1697 dev->num_tc = 0; 1692 dev->num_tc = 0;
1698 return; 1693 return;
1699 } 1694 }
@@ -1704,11 +1699,8 @@ static void netif_setup_tc(struct net_device *dev, unsigned int txq)
1704 1699
1705 tc = &dev->tc_to_txq[q]; 1700 tc = &dev->tc_to_txq[q];
1706 if (tc->offset + tc->count > txq) { 1701 if (tc->offset + tc->count > txq) {
1707 pr_warning("Number of in use tx queues " 1702 pr_warn("Number of in use tx queues changed. Priority %i to tc mapping %i is no longer valid. Setting map to 0\n",
1708 "changed. Priority %i to tc " 1703 i, q);
1709 "mapping %i is no longer valid "
1710 "setting map to 0\n",
1711 i, q);
1712 netdev_set_prio_tc_map(dev, i, 0); 1704 netdev_set_prio_tc_map(dev, i, 0);
1713 } 1705 }
1714 } 1706 }
@@ -2014,8 +2006,7 @@ EXPORT_SYMBOL(skb_gso_segment);
2014void netdev_rx_csum_fault(struct net_device *dev) 2006void netdev_rx_csum_fault(struct net_device *dev)
2015{ 2007{
2016 if (net_ratelimit()) { 2008 if (net_ratelimit()) {
2017 printk(KERN_ERR "%s: hw csum failure.\n", 2009 pr_err("%s: hw csum failure\n", dev ? dev->name : "<unknown>");
2018 dev ? dev->name : "<unknown>");
2019 dump_stack(); 2010 dump_stack();
2020 } 2011 }
2021} 2012}
@@ -2332,9 +2323,9 @@ static inline u16 dev_cap_txqueue(struct net_device *dev, u16 queue_index)
2332{ 2323{
2333 if (unlikely(queue_index >= dev->real_num_tx_queues)) { 2324 if (unlikely(queue_index >= dev->real_num_tx_queues)) {
2334 if (net_ratelimit()) { 2325 if (net_ratelimit()) {
2335 pr_warning("%s selects TX queue %d, but " 2326 pr_warn("%s selects TX queue %d, but real number of TX queues is %d\n",
2336 "real number of TX queues is %d\n", 2327 dev->name, queue_index,
2337 dev->name, queue_index, dev->real_num_tx_queues); 2328 dev->real_num_tx_queues);
2338 } 2329 }
2339 return 0; 2330 return 0;
2340 } 2331 }
@@ -2578,16 +2569,16 @@ int dev_queue_xmit(struct sk_buff *skb)
2578 } 2569 }
2579 HARD_TX_UNLOCK(dev, txq); 2570 HARD_TX_UNLOCK(dev, txq);
2580 if (net_ratelimit()) 2571 if (net_ratelimit())
2581 printk(KERN_CRIT "Virtual device %s asks to " 2572 pr_crit("Virtual device %s asks to queue packet!\n",
2582 "queue packet!\n", dev->name); 2573 dev->name);
2583 } else { 2574 } else {
2584 /* Recursion is detected! It is possible, 2575 /* Recursion is detected! It is possible,
2585 * unfortunately 2576 * unfortunately
2586 */ 2577 */
2587recursion_alert: 2578recursion_alert:
2588 if (net_ratelimit()) 2579 if (net_ratelimit())
2589 printk(KERN_CRIT "Dead loop on virtual device " 2580 pr_crit("Dead loop on virtual device %s, fix it urgently!\n",
2590 "%s, fix it urgently!\n", dev->name); 2581 dev->name);
2591 } 2582 }
2592 } 2583 }
2593 2584
@@ -3069,8 +3060,8 @@ static int ing_filter(struct sk_buff *skb, struct netdev_queue *rxq)
3069 3060
3070 if (unlikely(MAX_RED_LOOP < ttl++)) { 3061 if (unlikely(MAX_RED_LOOP < ttl++)) {
3071 if (net_ratelimit()) 3062 if (net_ratelimit())
3072 pr_warning( "Redir loop detected Dropping packet (%d->%d)\n", 3063 pr_warn("Redir loop detected Dropping packet (%d->%d)\n",
3073 skb->skb_iif, dev->ifindex); 3064 skb->skb_iif, dev->ifindex);
3074 return TC_ACT_SHOT; 3065 return TC_ACT_SHOT;
3075 } 3066 }
3076 3067
@@ -4491,16 +4482,15 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc)
4491 dev->flags &= ~IFF_PROMISC; 4482 dev->flags &= ~IFF_PROMISC;
4492 else { 4483 else {
4493 dev->promiscuity -= inc; 4484 dev->promiscuity -= inc;
4494 printk(KERN_WARNING "%s: promiscuity touches roof, " 4485 pr_warn("%s: promiscuity touches roof, set promiscuity failed. promiscuity feature of device might be broken.\n",
4495 "set promiscuity failed, promiscuity feature " 4486 dev->name);
4496 "of device might be broken.\n", dev->name);
4497 return -EOVERFLOW; 4487 return -EOVERFLOW;
4498 } 4488 }
4499 } 4489 }
4500 if (dev->flags != old_flags) { 4490 if (dev->flags != old_flags) {
4501 printk(KERN_INFO "device %s %s promiscuous mode\n", 4491 pr_info("device %s %s promiscuous mode\n",
4502 dev->name, (dev->flags & IFF_PROMISC) ? "entered" : 4492 dev->name,
4503 "left"); 4493 dev->flags & IFF_PROMISC ? "entered" : "left");
4504 if (audit_enabled) { 4494 if (audit_enabled) {
4505 current_uid_gid(&uid, &gid); 4495 current_uid_gid(&uid, &gid);
4506 audit_log(current->audit_context, GFP_ATOMIC, 4496 audit_log(current->audit_context, GFP_ATOMIC,
@@ -4573,9 +4563,8 @@ int dev_set_allmulti(struct net_device *dev, int inc)
4573 dev->flags &= ~IFF_ALLMULTI; 4563 dev->flags &= ~IFF_ALLMULTI;
4574 else { 4564 else {
4575 dev->allmulti -= inc; 4565 dev->allmulti -= inc;
4576 printk(KERN_WARNING "%s: allmulti touches roof, " 4566 pr_warn("%s: allmulti touches roof, set allmulti failed. allmulti feature of device might be broken.\n",
4577 "set allmulti failed, allmulti feature of " 4567 dev->name);
4578 "device might be broken.\n", dev->name);
4579 return -EOVERFLOW; 4568 return -EOVERFLOW;
4580 } 4569 }
4581 } 4570 }
@@ -5232,8 +5221,8 @@ static void rollback_registered_many(struct list_head *head)
5232 * devices and proceed with the remaining. 5221 * devices and proceed with the remaining.
5233 */ 5222 */
5234 if (dev->reg_state == NETREG_UNINITIALIZED) { 5223 if (dev->reg_state == NETREG_UNINITIALIZED) {
5235 pr_debug("unregister_netdevice: device %s/%p never " 5224 pr_debug("unregister_netdevice: device %s/%p never was registered\n",
5236 "was registered\n", dev->name, dev); 5225 dev->name, dev);
5237 5226
5238 WARN_ON(1); 5227 WARN_ON(1);
5239 list_del(&dev->unreg_list); 5228 list_del(&dev->unreg_list);
@@ -5465,7 +5454,7 @@ static int netif_alloc_rx_queues(struct net_device *dev)
5465 5454
5466 rx = kcalloc(count, sizeof(struct netdev_rx_queue), GFP_KERNEL); 5455 rx = kcalloc(count, sizeof(struct netdev_rx_queue), GFP_KERNEL);
5467 if (!rx) { 5456 if (!rx) {
5468 pr_err("netdev: Unable to allocate %u rx queues.\n", count); 5457 pr_err("netdev: Unable to allocate %u rx queues\n", count);
5469 return -ENOMEM; 5458 return -ENOMEM;
5470 } 5459 }
5471 dev->_rx = rx; 5460 dev->_rx = rx;
@@ -5499,8 +5488,7 @@ static int netif_alloc_netdev_queues(struct net_device *dev)
5499 5488
5500 tx = kcalloc(count, sizeof(struct netdev_queue), GFP_KERNEL); 5489 tx = kcalloc(count, sizeof(struct netdev_queue), GFP_KERNEL);
5501 if (!tx) { 5490 if (!tx) {
5502 pr_err("netdev: Unable to allocate %u tx queues.\n", 5491 pr_err("netdev: Unable to allocate %u tx queues\n", count);
5503 count);
5504 return -ENOMEM; 5492 return -ENOMEM;
5505 } 5493 }
5506 dev->_tx = tx; 5494 dev->_tx = tx;
@@ -5759,10 +5747,8 @@ static void netdev_wait_allrefs(struct net_device *dev)
5759 refcnt = netdev_refcnt_read(dev); 5747 refcnt = netdev_refcnt_read(dev);
5760 5748
5761 if (time_after(jiffies, warning_time + 10 * HZ)) { 5749 if (time_after(jiffies, warning_time + 10 * HZ)) {
5762 printk(KERN_EMERG "unregister_netdevice: " 5750 pr_emerg("unregister_netdevice: waiting for %s to become free. Usage count = %d\n",
5763 "waiting for %s to become free. Usage " 5751 dev->name, refcnt);
5764 "count = %d\n",
5765 dev->name, refcnt);
5766 warning_time = jiffies; 5752 warning_time = jiffies;
5767 } 5753 }
5768 } 5754 }
@@ -5813,7 +5799,7 @@ void netdev_run_todo(void)
5813 list_del(&dev->todo_list); 5799 list_del(&dev->todo_list);
5814 5800
5815 if (unlikely(dev->reg_state != NETREG_UNREGISTERING)) { 5801 if (unlikely(dev->reg_state != NETREG_UNREGISTERING)) {
5816 printk(KERN_ERR "network todo '%s' but state %d\n", 5802 pr_err("network todo '%s' but state %d\n",
5817 dev->name, dev->reg_state); 5803 dev->name, dev->reg_state);
5818 dump_stack(); 5804 dump_stack();
5819 continue; 5805 continue;
@@ -5929,15 +5915,13 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
5929 BUG_ON(strlen(name) >= sizeof(dev->name)); 5915 BUG_ON(strlen(name) >= sizeof(dev->name));
5930 5916
5931 if (txqs < 1) { 5917 if (txqs < 1) {
5932 pr_err("alloc_netdev: Unable to allocate device " 5918 pr_err("alloc_netdev: Unable to allocate device with zero queues\n");
5933 "with zero queues.\n");
5934 return NULL; 5919 return NULL;
5935 } 5920 }
5936 5921
5937#ifdef CONFIG_RPS 5922#ifdef CONFIG_RPS
5938 if (rxqs < 1) { 5923 if (rxqs < 1) {
5939 pr_err("alloc_netdev: Unable to allocate device " 5924 pr_err("alloc_netdev: Unable to allocate device with zero RX queues\n");
5940 "with zero RX queues.\n");
5941 return NULL; 5925 return NULL;
5942 } 5926 }
5943#endif 5927#endif
@@ -5953,7 +5937,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
5953 5937
5954 p = kzalloc(alloc_size, GFP_KERNEL); 5938 p = kzalloc(alloc_size, GFP_KERNEL);
5955 if (!p) { 5939 if (!p) {
5956 printk(KERN_ERR "alloc_netdev: Unable to allocate device.\n"); 5940 pr_err("alloc_netdev: Unable to allocate device\n");
5957 return NULL; 5941 return NULL;
5958 } 5942 }
5959 5943
@@ -6486,8 +6470,8 @@ static void __net_exit default_device_exit(struct net *net)
6486 snprintf(fb_name, IFNAMSIZ, "dev%d", dev->ifindex); 6470 snprintf(fb_name, IFNAMSIZ, "dev%d", dev->ifindex);
6487 err = dev_change_net_namespace(dev, &init_net, fb_name); 6471 err = dev_change_net_namespace(dev, &init_net, fb_name);
6488 if (err) { 6472 if (err) {
6489 printk(KERN_EMERG "%s: failed to move %s to init_net: %d\n", 6473 pr_emerg("%s: failed to move %s to init_net: %d\n",
6490 __func__, dev->name, err); 6474 __func__, dev->name, err);
6491 BUG(); 6475 BUG();
6492 } 6476 }
6493 } 6477 }