[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LSU.2.00.1204111739060.26607@eggly.anvils>
Date: Wed, 11 Apr 2012 17:41:13 -0700 (PDT)
From: Hugh Dickins <hughd@...gle.com>
To: Cong Wang <xiyou.wangcong@...il.com>
cc: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Oleg Nesterov <oleg@...hat.com>,
Alexey Dobriyan <adobriyan@...il.com>,
Al Viro <viro@...iv.linux.org.uk>,
Vasiliy Kulikov <segoon@...nwall.com>,
David Rientjes <rientjes@...gle.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
Siddhesh Poyarekar <siddhesh.poyarekar@...il.com>
Subject: Re: [PATCH 6/6] proc: use IS_ERR_OR_NULL()
On Wed, 11 Apr 2012, Cong Wang wrote:
> Cc: Oleg Nesterov <oleg@...hat.com>
> Cc: Alexey Dobriyan <adobriyan@...il.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
Whereas this one, I don't object, but I don't see it as an improvement.
> ---
> fs/proc/base.c | 2 +-
> fs/proc/task_mmu.c | 4 ++--
> fs/proc/task_nommu.c | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index 2dff86b..a72a409 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -239,7 +239,7 @@ static int proc_pid_auxv(struct task_struct *task, char *buffer)
> {
> struct mm_struct *mm = mm_access(task, PTRACE_MODE_READ);
> int res = PTR_ERR(mm);
> - if (mm && !IS_ERR(mm)) {
> + if (!IS_ERR_OR_NULL(mm)) {
> unsigned int nwords = 0;
> do {
> nwords += 2;
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index 03360a1..da4cf5f 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -126,7 +126,7 @@ static void *m_start(struct seq_file *m, loff_t *pos)
> return ERR_PTR(-ESRCH);
>
> mm = mm_access(priv->task, PTRACE_MODE_READ);
> - if (!mm || IS_ERR(mm))
> + if (IS_ERR_OR_NULL(mm))
> return mm;
> down_read(&mm->mmap_sem);
>
> @@ -916,7 +916,7 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
>
> mm = mm_access(task, PTRACE_MODE_READ);
> ret = PTR_ERR(mm);
> - if (!mm || IS_ERR(mm))
> + if (IS_ERR_OR_NULL(mm))
> goto out_free;
>
> pagemap_walk.pmd_entry = pagemap_pte_range;
> diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
> index 1ccfa53..57ad3cf 100644
> --- a/fs/proc/task_nommu.c
> +++ b/fs/proc/task_nommu.c
> @@ -224,7 +224,7 @@ static void *m_start(struct seq_file *m, loff_t *pos)
> return ERR_PTR(-ESRCH);
>
> mm = mm_access(priv->task, PTRACE_MODE_READ);
> - if (!mm || IS_ERR(mm)) {
> + if (IS_ERR_OR_NULL(mm)) {
> put_task_struct(priv->task);
> priv->task = NULL;
> return mm;
> --
> 1.7.7.6
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists