Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e005d193 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller
Browse files

net: core: Use pr_<level>



Use the current logging style.

This enables use of dynamic debugging as well.

Convert printk(KERN_<LEVEL> to pr_<level>.
Add pr_fmt. Remove embedded prefixes, use
%s, __func__ instead.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 675418d5
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@
 * Copyright (C) 2009 Neil Horman <nhorman@tuxdriver.com>
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/string.h>
@@ -381,10 +383,10 @@ static int __init init_net_drop_monitor(void)
	struct per_cpu_dm_data *data;
	int cpu, rc;

	printk(KERN_INFO "Initializing network drop monitor service\n");
	pr_info("Initializing network drop monitor service\n");

	if (sizeof(void *) > 8) {
		printk(KERN_ERR "Unable to store program counters on this arch, Drop monitor failed\n");
		pr_err("Unable to store program counters on this arch, Drop monitor failed\n");
		return -ENOSPC;
	}

@@ -392,13 +394,13 @@ static int __init init_net_drop_monitor(void)
					   dropmon_ops,
					   ARRAY_SIZE(dropmon_ops));
	if (rc) {
		printk(KERN_ERR "Could not create drop monitor netlink family\n");
		pr_err("Could not create drop monitor netlink family\n");
		return rc;
	}

	rc = register_netdevice_notifier(&dropmon_net_notifier);
	if (rc < 0) {
		printk(KERN_CRIT "Failed to register netdevice notifier\n");
		pr_crit("Failed to register netdevice notifier\n");
		goto out_unreg;
	}

+7 −6
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
 *	Harald Welte		Add neighbour cache statistics like rtstat
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/slab.h>
#include <linux/types.h>
#include <linux/kernel.h>
@@ -712,14 +714,13 @@ void neigh_destroy(struct neighbour *neigh)
	NEIGH_CACHE_STAT_INC(neigh->tbl, destroys);

	if (!neigh->dead) {
		printk(KERN_WARNING
		       "Destroying alive neighbour %p\n", neigh);
		pr_warn("Destroying alive neighbour %p\n", neigh);
		dump_stack();
		return;
	}

	if (neigh_del_timer(neigh))
		printk(KERN_WARNING "Impossible event.\n");
		pr_warn("Impossible event\n");

	skb_queue_purge(&neigh->arp_queue);
	neigh->arp_queue_len_bytes = 0;
@@ -1554,8 +1555,8 @@ void neigh_table_init(struct neigh_table *tbl)
	write_unlock(&neigh_tbl_lock);

	if (unlikely(tmp)) {
		printk(KERN_ERR "NEIGH: Registering multiple tables for "
		       "family %d\n", tbl->family);
		pr_err("Registering multiple tables for family %d\n",
		       tbl->family);
		dump_stack();
	}
}
@@ -1571,7 +1572,7 @@ int neigh_table_clear(struct neigh_table *tbl)
	pneigh_queue_purge(&tbl->proxy_queue);
	neigh_ifdown(tbl, NULL);
	if (atomic_read(&tbl->entries))
		printk(KERN_CRIT "neighbour leakage\n");
		pr_crit("neighbour leakage\n");
	write_lock(&neigh_tbl_lock);
	for (tp = &neigh_tables; *tp; tp = &(*tp)->next) {
		if (*tp == tbl) {
+4 −2
Original line number Diff line number Diff line
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/workqueue.h>
#include <linux/rtnetlink.h>
#include <linux/cache.h>
@@ -212,7 +214,7 @@ static void net_free(struct net *net)
{
#ifdef NETNS_REFCNT_DEBUG
	if (unlikely(atomic_read(&net->use_count) != 0)) {
		printk(KERN_EMERG "network namespace not free! Usage: %d\n",
		pr_emerg("network namespace not free! Usage: %d\n",
			 atomic_read(&net->use_count));
		return;
	}
+4 −2
Original line number Diff line number Diff line
@@ -9,6 +9,8 @@
 * Authors:	Neil Horman <nhorman@tuxdriver.com>
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/slab.h>
#include <linux/types.h>
@@ -88,7 +90,7 @@ static void extend_netdev_table(struct net_device *dev, u32 new_len)
	old_priomap  = rtnl_dereference(dev->priomap);

	if (!new_priomap) {
		printk(KERN_WARNING "Unable to alloc new priomap!\n");
		pr_warn("Unable to alloc new priomap!\n");
		return;
	}

@@ -136,7 +138,7 @@ static struct cgroup_subsys_state *cgrp_create(struct cgroup *cgrp)

	ret = get_prioidx(&cs->prioidx);
	if (ret != 0) {
		printk(KERN_WARNING "No space in priority index array\n");
		pr_warn("No space in priority index array\n");
		kfree(cs);
		return ERR_PTR(ret);
	}
+10 −10
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@
 *	The functions in this file will not compile correctly with gcc 2.4.x
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
@@ -118,9 +120,8 @@ static const struct pipe_buf_operations sock_pipe_buf_ops = {
 */
static void skb_over_panic(struct sk_buff *skb, int sz, void *here)
{
	printk(KERN_EMERG "skb_over_panic: text:%p len:%d put:%d head:%p "
			  "data:%p tail:%#lx end:%#lx dev:%s\n",
	       here, skb->len, sz, skb->head, skb->data,
	pr_emerg("%s: text:%p len:%d put:%d head:%p data:%p tail:%#lx end:%#lx dev:%s\n",
		 __func__, here, skb->len, sz, skb->head, skb->data,
		 (unsigned long)skb->tail, (unsigned long)skb->end,
		 skb->dev ? skb->dev->name : "<NULL>");
	BUG();
@@ -137,9 +138,8 @@ static void skb_over_panic(struct sk_buff *skb, int sz, void *here)

static void skb_under_panic(struct sk_buff *skb, int sz, void *here)
{
	printk(KERN_EMERG "skb_under_panic: text:%p len:%d put:%d head:%p "
			  "data:%p tail:%#lx end:%#lx dev:%s\n",
	       here, skb->len, sz, skb->head, skb->data,
	pr_emerg("%s: text:%p len:%d put:%d head:%p data:%p tail:%#lx end:%#lx dev:%s\n",
		 __func__, here, skb->len, sz, skb->head, skb->data,
		 (unsigned long)skb->tail, (unsigned long)skb->end,
		 skb->dev ? skb->dev->name : "<NULL>");
	BUG();
Loading