Thread (2 messages) 2 messages, 2 authors, 2011-01-21

Re: [PATCH 1/4] ppp: Clean up kernel log messages.

flat view

From: Joe Perches <joe@perches.com>
Date: 2011-01-21 19:30:34

On Thu, 2011-01-20 at 23:56 -0800, David Miller wrote:
Use netdev_*() and pr_*().
Perhaps it's better to standardize on "PPP: " or "ppp: "
for these outputs.

Maybe use pr_fmt(fmt) "ppp: " fmt or add a function like:

void ppp_printk(const char *level, const struct ppp* ppp, const char *fmt, ...)
{
	struct va_list args;
	struct va_format vaf;

	va_start(args, fmt);

	vaf.fmt = fmt;
	vaf.va = &args;
	if (ppp && ppp->dev)
		netdev_printk(level, ppp->dev, "ppp: %pV", &vaf);
	else
		printk("%sppp: %pV", level, &vaf);

	va_end(va);
}
and
#define ppp_err(ppp, fmt, ...) ppp_printk(KERN_ERR, ppp, fmt, ##__VA_ARGS__)
etc...
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
-			printk(KERN_DEBUG "PPPIOCDETACH file->f_count=%ld\n",
-			       atomic_long_read(&file->f_count));
+			pr_warn("PPPIOCDETACH file->f_count=%ld\n",
[]
-		printk(KERN_ERR "PPP: not interface or channel??\n");
+		pr_err("PPP: not interface or channel??\n");
[]
quoted hunk ↗ jump to hunk
 		if (net_ratelimit())
-			printk(KERN_ERR "ppp: compressor dropped pkt\n");
+			netdev_err(ppp->dev, "ppp: compressor dropped pkt\n");
[]
quoted hunk ↗ jump to hunk
-				printk(KERN_DEBUG "PPP: outbound frame not passed\n");
+				netdev_printk(KERN_DEBUG, ppp->dev,
+					      "PPP: outbound frame "
+					      "not passed\n");
[]
quoted hunk ↗ jump to hunk
-				printk(KERN_ERR "ppp: compression required but down - pkt dropped.\n");
+				netdev_err(ppp->dev,
+					   "ppp: compression required but "
+					   "down - pkt dropped.\n");
etc.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help