Netdev List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, paulus@samba.org
Subject: Re: [PATCH 1/4] ppp: Clean up kernel log messages.
Date: Fri, 21 Jan 2011 11:30:32 -0800	[thread overview]
Message-ID: <1295638232.25868.27.camel@Joe-Laptop> (raw)
In-Reply-To: <20110120.235601.139098188.davem@davemloft.net>

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...

> 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");
[]
>  		if (net_ratelimit())
> -			printk(KERN_ERR "ppp: compressor dropped pkt\n");
> +			netdev_err(ppp->dev, "ppp: compressor dropped pkt\n");
[]
> -				printk(KERN_DEBUG "PPP: outbound frame not passed\n");
> +				netdev_printk(KERN_DEBUG, ppp->dev,
> +					      "PPP: outbound frame "
> +					      "not passed\n");
[]
> -				printk(KERN_ERR "ppp: compression required but down - pkt dropped.\n");
> +				netdev_err(ppp->dev,
> +					   "ppp: compression required but "
> +					   "down - pkt dropped.\n");

etc.


      reply	other threads:[~2011-01-21 19:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-21  7:56 [PATCH 1/4] ppp: Clean up kernel log messages David Miller
2011-01-21 19:30 ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1295638232.25868.27.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox