From: Joe Perches <joe@perches.com>
To: Arushi Singhal <arushisinghal19971997@gmail.com>, pablo@netfilter.org
Cc: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
Florian Westphal <fw@strlen.de>,
"David S. Miller" <davem@davemloft.net>,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] net: netfilter: Replace printk() with appropriate pr_*() macro
Date: Sun, 11 Mar 2018 12:52:41 -0700 [thread overview]
Message-ID: <1520797961.19456.4.camel@perches.com> (raw)
In-Reply-To: <20180311194104.GA17450@seema-Inspiron-15-3567>
On Mon, 2018-03-12 at 01:11 +0530, Arushi Singhal wrote:
> Using pr_<loglevel>() is more concise than
> printk(KERN_<LOGLEVEL>).
> Replace printks having a log level with the appropriate
> pr_*() macros.
>
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
> changes in v2
> *in v1 printk() were replaced with netdev_*()
> net/netfilter/nf_conntrack_acct.c | 2 +-
> net/netfilter/nf_conntrack_ecache.c | 2 +-
> net/netfilter/nf_conntrack_timestamp.c | 2 +-
> net/netfilter/nf_nat_core.c | 2 +-
> net/netfilter/nfnetlink_queue.c | 4 ++--
> 5 files changed, 6 insertions(+), 6 deletions(-)
None of these files have a #define for pr_fmt so this
should be OK.
Perhaps coalesce the formats and remove the unnecessary periods too.
> diff --git a/net/netfilter/nf_conntrack_acct.c b/net/netfilter/nf_conntrack_acct.c
[]
> @@ -80,7 +80,7 @@ static int nf_conntrack_acct_init_sysctl(struct net *net)
> net->ct.acct_sysctl_header = register_net_sysctl(net, "net/netfilter",
> table);
> if (!net->ct.acct_sysctl_header) {
> - printk(KERN_ERR "nf_conntrack_acct: can't register to sysctl.\n");
> + pr_err("nf_conntrack_acct: can't register to sysctl.\n");
> goto out_register;
> }
> return 0;
etc...
> diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
[]
> @@ -834,8 +834,8 @@ nfqnl_mangle(void *data, int data_len, struct nf_queue_entry *e, int diff)
> nskb = skb_copy_expand(e->skb, skb_headroom(e->skb),
> diff, GFP_ATOMIC);
> if (!nskb) {
> - printk(KERN_WARNING "nf_queue: OOM "
> - "in mangle, dropping packet\n");
> + pr_warn("nf_queue: OOM "
> + "in mangle, dropping packet\n");
> return -ENOMEM;
> }
> kfree_skb(e->skb);
next prev parent reply other threads:[~2018-03-11 19:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-11 19:41 [PATCH v2] net: netfilter: Replace printk() with appropriate pr_*() macro Arushi Singhal
2018-03-11 19:52 ` Joe Perches [this message]
2018-03-11 20:47 ` Pablo Neira Ayuso
[not found] ` <CA+XqjF-HhYADuFicA1S4tmU2Hfi2bAWinO2DR4g42ORkyGMW_A@mail.gmail.com>
2018-03-11 22:28 ` Pablo Neira Ayuso
2018-03-11 22:31 ` Florian Westphal
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=1520797961.19456.4.camel@perches.com \
--to=joe@perches.com \
--cc=arushisinghal19971997@gmail.com \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=fw@strlen.de \
--cc=kadlec@blackhole.kfki.hu \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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.