[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1301296053-23589-1-git-send-email-amwang@redhat.com>
Date: Mon, 28 Mar 2011 15:07:31 +0800
From: Amerigo Wang <amwang@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: torvalds@...ux-foundation.org, Amerigo Wang <amwang@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Eric B Munson <emunson@...bm.net>,
David Rientjes <rientjes@...gle.com>,
Dave Hansen <dave@...ux.vnet.ibm.com>,
Mel Gorman <mel@....ul.ie>, Mike Frysinger <vapier@...too.org>,
David Howells <dhowells@...hat.com>,
Alexey Dobriyan <adobriyan@...il.com>,
Al Viro <viro@...iv.linux.org.uk>
Subject: [PATCH 1/2] proc: Use IS_ERR_OR_NULL() helper
Use IS_ERR_OR_NULL() helper
Signed-off-by: Amerigo Wang <amwang@...hat.com>
---
fs/proc/task_mmu.c | 10 ++++++----
fs/proc/task_nommu.c | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 2e7addf..3c06570 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -124,7 +124,7 @@ static void *m_start(struct seq_file *m, loff_t *pos)
return ERR_PTR(-ESRCH);
mm = mm_for_maps(priv->task);
- if (!mm || IS_ERR(mm))
+ if (IS_ERR_OR_NULL(mm))
return mm;
down_read(&mm->mmap_sem);
@@ -182,7 +182,7 @@ static void m_stop(struct seq_file *m, void *v)
struct proc_maps_private *priv = m->private;
struct vm_area_struct *vma = v;
- if (!IS_ERR(vma))
+ if (!IS_ERR_OR_NULL(vma))
vma_stop(priv, vma);
if (priv->task)
put_task_struct(priv->task);
@@ -768,9 +768,11 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
goto out;
mm = mm_for_maps(task);
- ret = PTR_ERR(mm);
- if (!mm || IS_ERR(mm))
+ if (IS_ERR_OR_NULL(mm)) {
+ if (mm)
+ ret = PTR_ERR(mm);
goto out_task;
+ }
ret = -EINVAL;
/* file position must be aligned */
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
index 980de54..35e8b2a 100644
--- a/fs/proc/task_nommu.c
+++ b/fs/proc/task_nommu.c
@@ -202,7 +202,7 @@ static void *m_start(struct seq_file *m, loff_t *pos)
return ERR_PTR(-ESRCH);
mm = mm_for_maps(priv->task);
- if (!mm || IS_ERR(mm)) {
+ if (IS_ERR_OR_NULL(mm)) {
put_task_struct(priv->task);
priv->task = NULL;
return mm;
--
1.7.4
--
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