Commit 7b6cd1ce authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c3ca881f
...@@ -446,7 +446,7 @@ void __dev_remove_pack(struct packet_type *pt) ...@@ -446,7 +446,7 @@ void __dev_remove_pack(struct packet_type *pt)
} }
} }
printk(KERN_WARNING "dev_remove_pack: %p not found.\n", pt); pr_warn("dev_remove_pack: %p not found\n", pt);
out: out:
spin_unlock(&ptype_lock); spin_unlock(&ptype_lock);
} }
...@@ -1039,8 +1039,7 @@ int dev_change_name(struct net_device *dev, const char *newname) ...@@ -1039,8 +1039,7 @@ int dev_change_name(struct net_device *dev, const char *newname)
memcpy(dev->name, oldname, IFNAMSIZ); memcpy(dev->name, oldname, IFNAMSIZ);
goto rollback; goto rollback;
} else { } else {
printk(KERN_ERR pr_err("%s: name change rollback failed: %d\n",
"%s: name change rollback failed: %d.\n",
dev->name, ret); dev->name, ret);
} }
} }
...@@ -1139,9 +1138,8 @@ void dev_load(struct net *net, const char *name) ...@@ -1139,9 +1138,8 @@ void dev_load(struct net *net, const char *name)
no_module = request_module("netdev-%s", name); no_module = request_module("netdev-%s", name);
if (no_module && capable(CAP_SYS_MODULE)) { if (no_module && capable(CAP_SYS_MODULE)) {
if (!request_module("%s", name)) if (!request_module("%s", name))
pr_err("Loading kernel module for a network device " pr_err("Loading kernel module for a network device with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s instead.\n",
"with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s " name);
"instead\n", name);
} }
} }
EXPORT_SYMBOL(dev_load); EXPORT_SYMBOL(dev_load);
...@@ -1655,10 +1653,9 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) ...@@ -1655,10 +1653,9 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
if (skb_network_header(skb2) < skb2->data || if (skb_network_header(skb2) < skb2->data ||
skb2->network_header > skb2->tail) { skb2->network_header > skb2->tail) {
if (net_ratelimit()) if (net_ratelimit())
printk(KERN_CRIT "protocol %04x is " pr_crit("protocol %04x is buggy, dev %s\n",
"buggy, dev %s\n", ntohs(skb2->protocol),
ntohs(skb2->protocol), dev->name);
dev->name);
skb_reset_network_header(skb2); skb_reset_network_header(skb2);
} }
...@@ -1691,9 +1688,7 @@ static void netif_setup_tc(struct net_device *dev, unsigned int txq) ...@@ -1691,9 +1688,7 @@ static void netif_setup_tc(struct net_device *dev, unsigned int txq)
/* If TC0 is invalidated disable TC mapping */ /* If TC0 is invalidated disable TC mapping */
if (tc->offset + tc->count > txq) { if (tc->offset + tc->count > txq) {
pr_warning("Number of in use tx queues changed " pr_warn("Number of in use tx queues changed invalidating tc mappings. Priority traffic classification disabled!\n");
"invalidating tc mappings. Priority "
"traffic classification disabled!\n");
dev->num_tc = 0; dev->num_tc = 0;
return; return;
} }
...@@ -1704,11 +1699,8 @@ static void netif_setup_tc(struct net_device *dev, unsigned int txq) ...@@ -1704,11 +1699,8 @@ static void netif_setup_tc(struct net_device *dev, unsigned int txq)
tc = &dev->tc_to_txq[q]; tc = &dev->tc_to_txq[q];
if (tc->offset + tc->count > txq) { if (tc->offset + tc->count > txq) {
pr_warning("Number of in use tx queues " pr_warn("Number of in use tx queues changed. Priority %i to tc mapping %i is no longer valid. Setting map to 0\n",
"changed. Priority %i to tc " i, q);
"mapping %i is no longer valid "
"setting map to 0\n",
i, q);
netdev_set_prio_tc_map(dev, i, 0); netdev_set_prio_tc_map(dev, i, 0);
} }
} }
...@@ -2014,8 +2006,7 @@ EXPORT_SYMBOL(skb_gso_segment); ...@@ -2014,8 +2006,7 @@ EXPORT_SYMBOL(skb_gso_segment);
void netdev_rx_csum_fault(struct net_device *dev) void netdev_rx_csum_fault(struct net_device *dev)
{ {
if (net_ratelimit()) { if (net_ratelimit()) {
printk(KERN_ERR "%s: hw csum failure.\n", pr_err("%s: hw csum failure\n", dev ? dev->name : "<unknown>");
dev ? dev->name : "<unknown>");
dump_stack(); dump_stack();
} }
} }
...@@ -2332,9 +2323,9 @@ static inline u16 dev_cap_txqueue(struct net_device *dev, u16 queue_index) ...@@ -2332,9 +2323,9 @@ static inline u16 dev_cap_txqueue(struct net_device *dev, u16 queue_index)
{ {
if (unlikely(queue_index >= dev->real_num_tx_queues)) { if (unlikely(queue_index >= dev->real_num_tx_queues)) {
if (net_ratelimit()) { if (net_ratelimit()) {
pr_warning("%s selects TX queue %d, but " pr_warn("%s selects TX queue %d, but real number of TX queues is %d\n",
"real number of TX queues is %d\n", dev->name, queue_index,
dev->name, queue_index, dev->real_num_tx_queues); dev->real_num_tx_queues);
} }
return 0; return 0;
} }
...@@ -2578,16 +2569,16 @@ int dev_queue_xmit(struct sk_buff *skb) ...@@ -2578,16 +2569,16 @@ int dev_queue_xmit(struct sk_buff *skb)
} }
HARD_TX_UNLOCK(dev, txq); HARD_TX_UNLOCK(dev, txq);
if (net_ratelimit()) if (net_ratelimit())
printk(KERN_CRIT "Virtual device %s asks to " pr_crit("Virtual device %s asks to queue packet!\n",
"queue packet!\n", dev->name); dev->name);
} else { } else {
/* Recursion is detected! It is possible, /* Recursion is detected! It is possible,
* unfortunately * unfortunately
*/ */
recursion_alert: recursion_alert:
if (net_ratelimit()) if (net_ratelimit())
printk(KERN_CRIT "Dead loop on virtual device " pr_crit("Dead loop on virtual device %s, fix it urgently!\n",
"%s, fix it urgently!\n", dev->name); dev->name);
} }
} }
...@@ -3069,8 +3060,8 @@ static int ing_filter(struct sk_buff *skb, struct netdev_queue *rxq) ...@@ -3069,8 +3060,8 @@ static int ing_filter(struct sk_buff *skb, struct netdev_queue *rxq)
if (unlikely(MAX_RED_LOOP < ttl++)) { if (unlikely(MAX_RED_LOOP < ttl++)) {
if (net_ratelimit()) if (net_ratelimit())
pr_warning( "Redir loop detected Dropping packet (%d->%d)\n", pr_warn("Redir loop detected Dropping packet (%d->%d)\n",
skb->skb_iif, dev->ifindex); skb->skb_iif, dev->ifindex);
return TC_ACT_SHOT; return TC_ACT_SHOT;
} }
...@@ -4491,16 +4482,15 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc) ...@@ -4491,16 +4482,15 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc)
dev->flags &= ~IFF_PROMISC; dev->flags &= ~IFF_PROMISC;
else { else {
dev->promiscuity -= inc; dev->promiscuity -= inc;
printk(KERN_WARNING "%s: promiscuity touches roof, " pr_warn("%s: promiscuity touches roof, set promiscuity failed. promiscuity feature of device might be broken.\n",
"set promiscuity failed, promiscuity feature " dev->name);
"of device might be broken.\n", dev->name);
return -EOVERFLOW; return -EOVERFLOW;
} }
} }
if (dev->flags != old_flags) { if (dev->flags != old_flags) {
printk(KERN_INFO "device %s %s promiscuous mode\n", pr_info("device %s %s promiscuous mode\n",
dev->name, (dev->flags & IFF_PROMISC) ? "entered" : dev->name,
"left"); dev->flags & IFF_PROMISC ? "entered" : "left");
if (audit_enabled) { if (audit_enabled) {
current_uid_gid(&uid, &gid); current_uid_gid(&uid, &gid);
audit_log(current->audit_context, GFP_ATOMIC, audit_log(current->audit_context, GFP_ATOMIC,
...@@ -4573,9 +4563,8 @@ int dev_set_allmulti(struct net_device *dev, int inc) ...@@ -4573,9 +4563,8 @@ int dev_set_allmulti(struct net_device *dev, int inc)
dev->flags &= ~IFF_ALLMULTI; dev->flags &= ~IFF_ALLMULTI;
else { else {
dev->allmulti -= inc; dev->allmulti -= inc;
printk(KERN_WARNING "%s: allmulti touches roof, " pr_warn("%s: allmulti touches roof, set allmulti failed. allmulti feature of device might be broken.\n",
"set allmulti failed, allmulti feature of " dev->name);
"device might be broken.\n", dev->name);
return -EOVERFLOW; return -EOVERFLOW;
} }
} }
...@@ -5232,8 +5221,8 @@ static void rollback_registered_many(struct list_head *head) ...@@ -5232,8 +5221,8 @@ static void rollback_registered_many(struct list_head *head)
* devices and proceed with the remaining. * devices and proceed with the remaining.
*/ */
if (dev->reg_state == NETREG_UNINITIALIZED) { if (dev->reg_state == NETREG_UNINITIALIZED) {
pr_debug("unregister_netdevice: device %s/%p never " pr_debug("unregister_netdevice: device %s/%p never was registered\n",
"was registered\n", dev->name, dev); dev->name, dev);
WARN_ON(1); WARN_ON(1);
list_del(&dev->unreg_list); list_del(&dev->unreg_list);
...@@ -5465,7 +5454,7 @@ static int netif_alloc_rx_queues(struct net_device *dev) ...@@ -5465,7 +5454,7 @@ static int netif_alloc_rx_queues(struct net_device *dev)
rx = kcalloc(count, sizeof(struct netdev_rx_queue), GFP_KERNEL); rx = kcalloc(count, sizeof(struct netdev_rx_queue), GFP_KERNEL);
if (!rx) { if (!rx) {
pr_err("netdev: Unable to allocate %u rx queues.\n", count); pr_err("netdev: Unable to allocate %u rx queues\n", count);
return -ENOMEM; return -ENOMEM;
} }
dev->_rx = rx; dev->_rx = rx;
...@@ -5499,8 +5488,7 @@ static int netif_alloc_netdev_queues(struct net_device *dev) ...@@ -5499,8 +5488,7 @@ static int netif_alloc_netdev_queues(struct net_device *dev)
tx = kcalloc(count, sizeof(struct netdev_queue), GFP_KERNEL); tx = kcalloc(count, sizeof(struct netdev_queue), GFP_KERNEL);
if (!tx) { if (!tx) {
pr_err("netdev: Unable to allocate %u tx queues.\n", pr_err("netdev: Unable to allocate %u tx queues\n", count);
count);
return -ENOMEM; return -ENOMEM;
} }
dev->_tx = tx; dev->_tx = tx;
...@@ -5759,10 +5747,8 @@ static void netdev_wait_allrefs(struct net_device *dev) ...@@ -5759,10 +5747,8 @@ static void netdev_wait_allrefs(struct net_device *dev)
refcnt = netdev_refcnt_read(dev); refcnt = netdev_refcnt_read(dev);
if (time_after(jiffies, warning_time + 10 * HZ)) { if (time_after(jiffies, warning_time + 10 * HZ)) {
printk(KERN_EMERG "unregister_netdevice: " pr_emerg("unregister_netdevice: waiting for %s to become free. Usage count = %d\n",
"waiting for %s to become free. Usage " dev->name, refcnt);
"count = %d\n",
dev->name, refcnt);
warning_time = jiffies; warning_time = jiffies;
} }
} }
...@@ -5813,7 +5799,7 @@ void netdev_run_todo(void) ...@@ -5813,7 +5799,7 @@ void netdev_run_todo(void)
list_del(&dev->todo_list); list_del(&dev->todo_list);
if (unlikely(dev->reg_state != NETREG_UNREGISTERING)) { if (unlikely(dev->reg_state != NETREG_UNREGISTERING)) {
printk(KERN_ERR "network todo '%s' but state %d\n", pr_err("network todo '%s' but state %d\n",
dev->name, dev->reg_state); dev->name, dev->reg_state);
dump_stack(); dump_stack();
continue; continue;
...@@ -5929,15 +5915,13 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, ...@@ -5929,15 +5915,13 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
BUG_ON(strlen(name) >= sizeof(dev->name)); BUG_ON(strlen(name) >= sizeof(dev->name));
if (txqs < 1) { if (txqs < 1) {
pr_err("alloc_netdev: Unable to allocate device " pr_err("alloc_netdev: Unable to allocate device with zero queues\n");
"with zero queues.\n");
return NULL; return NULL;
} }
#ifdef CONFIG_RPS #ifdef CONFIG_RPS
if (rxqs < 1) { if (rxqs < 1) {
pr_err("alloc_netdev: Unable to allocate device " pr_err("alloc_netdev: Unable to allocate device with zero RX queues\n");
"with zero RX queues.\n");
return NULL; return NULL;
} }
#endif #endif
...@@ -5953,7 +5937,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, ...@@ -5953,7 +5937,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
p = kzalloc(alloc_size, GFP_KERNEL); p = kzalloc(alloc_size, GFP_KERNEL);
if (!p) { if (!p) {
printk(KERN_ERR "alloc_netdev: Unable to allocate device.\n"); pr_err("alloc_netdev: Unable to allocate device\n");
return NULL; return NULL;
} }
...@@ -6486,8 +6470,8 @@ static void __net_exit default_device_exit(struct net *net) ...@@ -6486,8 +6470,8 @@ static void __net_exit default_device_exit(struct net *net)
snprintf(fb_name, IFNAMSIZ, "dev%d", dev->ifindex); snprintf(fb_name, IFNAMSIZ, "dev%d", dev->ifindex);
err = dev_change_net_namespace(dev, &init_net, fb_name); err = dev_change_net_namespace(dev, &init_net, fb_name);
if (err) { if (err) {
printk(KERN_EMERG "%s: failed to move %s to init_net: %d\n", pr_emerg("%s: failed to move %s to init_net: %d\n",
__func__, dev->name, err); __func__, dev->name, err);
BUG(); BUG();
} }
} }
......
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