lkml.org 
[lkml]   [2011]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] proc: Use IS_ERR_OR_NULL() helper
Date
Use IS_ERR_OR_NULL() helper

Signed-off-by: Amerigo Wang <amwang@redhat.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


\
 
 \ /
  Last update: 2011-03-28 09:11    [W:0.052 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site