From: Michael Heimpold <mhei@heimpold.de>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 5/5] sched: replace bare printks
Date: Fri, 29 Aug 2014 22:12:04 +0200 [thread overview]
Message-ID: <2929572.cMoKUE6Fhc@kerker> (raw)
In-Reply-To: <20140829071035.547171617@networkplumber.org>
Am Freitag, 29. August 2014, 00:09:23 schrieb Stephen Hemminger:
> Don't use bare printk for error messages.
> Make GRED error an info level message rather than debug which
> is likely to be suppressed.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>
>
> --- a/net/sched/act_ipt.c 2014-03-28 11:40:43.000000000 -0700
> +++ b/net/sched/act_ipt.c 2014-08-22 16:53:33.676030680 -0700
> @@ -290,10 +290,10 @@ static int __init ipt_init_module(void)
>
> ret1 = tcf_register_action(&act_xt_ops, IPT_TAB_MASK);
> if (ret1 < 0)
> - printk("Failed to load xt action\n");
> + pr_err("Failed to load xt action\n");
> ret2 = tcf_register_action(&act_ipt_ops, IPT_TAB_MASK);
> if (ret2 < 0)
> - printk("Failed to load ipt action\n");
> + pr_err("Failed to load ipt action\n");
>
> if (ret1 < 0 && ret2 < 0) {
> return ret1;
> --- a/net/sched/act_mirred.c 2014-08-12 13:07:42.000000000 -0700
> +++ b/net/sched/act_mirred.c 2014-08-22 16:54:07.244031579 -0700
> @@ -140,7 +140,7 @@ static int tcf_mirred(struct sk_buff *sk
>
> dev = m->tcfm_dev;
> if (!dev) {
> - printk_once(KERN_NOTICE "tc mirred: target device is gone\n");
> + netdev_notice(dev, "tc mirred: target device is gone\n");
> goto out;
> }
At my first look, I was wondering whether this could work as 'dev' is not
a valid pointer inside the if statement body. But after trying to trace to call
down, I found that it ends up as
printk("%s(NULL net_device): %pV" ...
within __netdev_printk.
Is this the desired output in this case?
Or did I miss anything?
>
> --- a/net/sched/sch_gred.c 2014-03-28 11:40:43.000000000 -0700
> +++ b/net/sched/sch_gred.c 2014-08-22 16:54:47.720032663 -0700
> @@ -456,8 +456,8 @@ static int gred_change(struct Qdisc *sch
> if (table->tab[table->def])
> def_prio = table->tab[table->def]->prio;
>
> - printk(KERN_DEBUG "GRED: DP %u does not have a prio "
> - "setting default to %d\n", ctl->DP, def_prio);
> + pr_info("GRED: DP %u does not have a prio "
> + "setting default to %d\n", ctl->DP, def_prio);
>
> prio = def_prio;
> } else
>
Best regards,
Michael
next prev parent reply other threads:[~2014-08-29 20:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-29 7:09 [PATCH net-next 0/5] printk message cleanup's Stephen Hemminger
2014-08-29 7:09 ` [PATCH net-next 1/5] net: fix message priorities Stephen Hemminger
2014-08-29 7:09 ` [PATCH net-next 2/5] tcp: silence useless debug message Stephen Hemminger
2014-08-29 7:09 ` [PATCH net-next 3/5] ipv6: silence tunnel loading messages Stephen Hemminger
2014-08-29 7:09 ` [PATCH net-next 4/5] xfrm: replace printk with pr_ macro Stephen Hemminger
2014-08-29 7:09 ` [PATCH net-next 5/5] sched: replace bare printks Stephen Hemminger
2014-08-29 20:12 ` Michael Heimpold [this message]
2014-09-02 1:16 ` David Miller
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=2929572.cMoKUE6Fhc@kerker \
--to=mhei@heimpold.de \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.