From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Bastian Stender <bst@pengutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
James Morris <jmorris@namei.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Patrick McHardy <kaber@trash.net>,
netdev@vger.kernel.org, trivial@kernel.org,
kernel@pengutronix.de, Joe Perches <joe@perches.com>
Subject: Re: [PATCH] net ipv4: use preferred log methods
Date: Thu, 1 Oct 2015 09:55:30 +0200 [thread overview]
Message-ID: <20151001075530.GL3982@pengutronix.de> (raw)
In-Reply-To: <1443625231-1871-1-git-send-email-bst@pengutronix.de>
Hello Basti,
Cc += Joe Perches
On Wed, Sep 30, 2015 at 05:00:31PM +0200, Bastian Stender wrote:
> Replace printk calls with preferred unconditional log method calls to keep
> kernel messages clean.
>
> Signed-off-by: Bastian Stender <bst@pengutronix.de>
> ---
> net/ipv4/ipconfig.c | 77 +++++-------
> net/ipv4/netfilter/arp_tables.c | 165 +++++++++++--------------
> net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 2 +-
> net/ipv4/netfilter/nf_nat_snmp_basic.c | 31 +++--
> 4 files changed, 122 insertions(+), 153 deletions(-)
>
> diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
> index ed4ef09..50ec7c6 100644
> --- a/net/ipv4/ipconfig.c
> +++ b/net/ipv4/ipconfig.c
> [...]
> @@ -857,12 +848,12 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
> if (dev_hard_header(skb, dev, ntohs(skb->protocol),
> dev->broadcast, dev->dev_addr, skb->len) < 0) {
> kfree_skb(skb);
> - printk("E");
> + pr_alert("E\n");
> return;
> }
>
> if (dev_queue_xmit(skb) < 0)
> - printk("E");
> + pr_alert("E\n");
I'm not sure about this change. If after
printk("E");
printk("E");
both E are on the same line I'd say switching to pr_alert and adding \n
is bad. I don't know off-hand if that's the case, maybe Joe does?
> [...]
> diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c
> index 7c67667..78f63f5 100644
> --- a/net/ipv4/netfilter/nf_nat_snmp_basic.c
> +++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c
> @@ -915,8 +915,7 @@ static inline void mangle_address(unsigned char *begin,
> }
>
> if (debug)
> - printk(KERN_DEBUG "bsalg: mapped %pI4 to %pI4\n",
> - &old, addr);
> + pr_debug("bsalg: mapped %pI4 to %pI4\n", &old, addr);
This is also a change in behaviour. The removed line results in the
message making it into the kernel log buffer unconditionally (though
probably not on the console). The newly added line is a noop however
unless DEBUG is defined. This doesn't mean the change is bad, but at
least it's not in the scope for a trivial cleanup patch that just
converts existing code to the modern way with no intend to change
behaviour.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2015-10-01 7:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-25 9:58 [PATCH] net ipv4 ipconfig: use preferred log methods Bastian Stender
2015-09-28 5:37 ` Stephen Hemminger
2015-09-29 5:24 ` David Miller
2015-09-30 9:20 ` [PATCH] net ipv4: " Bastian Stender
2015-09-30 9:31 ` kbuild test robot
2015-09-30 9:31 ` kbuild test robot
2015-09-30 11:07 ` Bastian Stender
2015-09-30 15:00 ` Bastian Stender
2015-10-01 7:55 ` Uwe Kleine-König [this message]
2015-11-13 10:40 ` [PATCH v2] " Bastian Stender
2015-11-13 10:40 ` [PATCH] " Bastian Stender
2015-11-18 18:38 ` 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=20151001075530.GL3982@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=bst@pengutronix.de \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=joe@perches.com \
--cc=kaber@trash.net \
--cc=kernel@pengutronix.de \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=trivial@kernel.org \
--cc=yoshfuji@linux-ipv6.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;
as well as URLs for NNTP newsgroup(s).