From: Joe Perches <joe@perches.com>
To: akpm@linux-foundation.org
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [patch 1/1] fs/proc: clean up printks
Date: Sun, 03 Feb 2013 12:59:45 -0800 [thread overview]
Message-ID: <1359925185.32609.11.camel@joe-AO722> (raw)
In-Reply-To: <20130131222036.25A0A5A4082@corp2gmr1-2.hot.corp.google.com>
On Thu, 2013-01-31 at 14:20 -0800, akpm@linux-foundation.org wrote:
> From: Andrew Morton <akpm@linux-foundation.org>
> Subject: fs/proc: clean up printks
>
> - use pr_foo() throughout
>
> - remove a couple of duplicated KERN_WARNINGs, via WARN(KERN_WARNING "...")
>
> - nuke a few warnings which I've never seen happen, ever.
Ignorable trivial comments only:
o Use pr_warn instead of pr_warning
o Consider using "%s: ...", __func__, ...
instead of "function_name: ...", ...
o As printk.h is included by kernel.h, and that
is unlikely to be changed, it's probably not
useful/necessary to add #include <linux/printk.h>
anywhere
o Consider using #define pr_fmt(fmt) where useful
o Consider coalescing formats
o Consider realigning arguments after name changes
> diff -puN fs/proc/base.c~fs-proc-clean-up-printks fs/proc/base.c
> @@ -952,7 +953,7 @@ static ssize_t oom_adj_write(struct file
[]
> - printk_once(KERN_WARNING "%s (%d): /proc/%d/oom_adj is deprecated, please use /proc/%d/oom_score_adj instead.\n",
> + pr_warn_once("%s (%d): /proc/%d/oom_adj is deprecated, please use /proc/%d/oom_score_adj instead.\n",
> current->comm, task_pid_nr(current), task_pid_nr(task),
> task_pid_nr(task));
Align args
> diff -puN fs/proc/generic.c~fs-proc-clean-up-printks fs/proc/generic.c
[]
> - printk(KERN_WARNING
> - "proc_file_read: Read count exceeded\n");
> + pr_warn("proc_file_read: count exceeded\n");
"%s: ...", __func__,
> @@ -837,7 +828,7 @@ void remove_proc_entry(const char *name,
[]
> - WARN(de->subdir, KERN_WARNING "%s: removing non-empty directory "
> + WARN(de->subdir, "%s: removing non-empty directory "
> "'%s/%s', leaking at least '%s'\n", __func__,
coalesce, align
> diff -puN fs/proc/inode.c~fs-proc-clean-up-printks fs/proc/inode.c
[]
> @@ -498,14 +499,14 @@ int proc_fill_super(struct super_block *
> - printk(KERN_ERR "proc_fill_super: get root inode failed\n");
> + pr_warn("proc_fill_super: get root inode failed\n");
"%s: ...", __func__,
> - printk(KERN_ERR "proc_fill_super: allocate dentry failed\n");
> + pr_err("proc_fill_super: allocate dentry failed\n");
etc...
> diff -puN fs/proc/proc_devtree.c~fs-proc-clean-up-printks fs/proc/proc_devtree.c
> --- a/fs/proc/proc_devtree.c~fs-proc-clean-up-printks
> +++ a/fs/proc/proc_devtree.c
> @@ -8,6 +8,7 @@
pr_fmt?
> diff -puN fs/proc/proc_sysctl.c~fs-proc-clean-up-printks fs/proc/proc_sysctl.c
[]
> @@ -995,8 +996,8 @@ static int sysctl_err(const char *path,
[]
> - printk(KERN_ERR "sysctl table check failed: %s/%s %pV\n",
> - path, table->procname, &vaf);
> + pr_err("sysctl table check failed: %s/%s %pV\n",
> + path, table->procname, &vaf);
Align args?
> diff -puN fs/proc/vmcore.c~fs-proc-clean-up-printks fs/proc/vmcore.c
[]
> @@ -553,8 +554,7 @@ static int __init parse_crash_elf64_head
[]
> - printk(KERN_WARNING "Warning: Core image elf header is not"
> - "sane\n");
> + pr_warning("Warning: Core image elf header is not sane\n");
pr_warn (many times)
next prev parent reply other threads:[~2013-02-03 20:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-31 22:20 [patch 1/1] fs/proc: clean up printks akpm
2013-02-03 20:59 ` Joe Perches [this message]
2013-02-07 23:49 ` Andrew Morton
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=1359925185.32609.11.camel@joe-AO722 \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.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).