Skip to contentSkip to conversation

Cpuset: remove unnecessary NULL check

PATCH New Paul Jackson 1 participant 1 message Mar 2, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Cpuset: remove unnecessary NULL check

From: Paul Jackson <[email protected]>

Remove a no longer needed test for NULL cpuset pointer, with a little comment explaining why the test isn't needed.

---

 kernel/cpuset.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
kernel/cpuset.c +3 -6
@@ -2374,12 +2374,12 @@ void __cpuset_memory_pressure_bump(void)
  *  - No need to task_lock(tsk) on this tsk->cpuset reference, as it
  *    doesn't really matter if tsk->cpuset changes after we read it,
  *    and we take manage_mutex, keeping attach_task() from changing it
- *    anyway.
+ *    anyway.  No need to check that tsk->cpuset != NULL, thanks to the
+ *    cpuset_exit() Hack.
  */
 
 int cpuset_proc_show_path(struct seq_file *m, void *v)
 {
-	struct cpuset *cs;
 	struct task_ref *tref;
 	struct task_struct *tsk;
 	char *buf;
@@ -2398,11 +2398,8 @@ int cpuset_proc_show_path(struct seq_fil
 
 	retval = -EINVAL;
 	mutex_lock(&manage_mutex);
-	cs = tsk->cpuset;
-	if (!cs)
-		goto out_unlock;
 
-	retval = cpuset_path(cs, buf, PAGE_SIZE);
+	retval = cpuset_path(tsk->cpuset, buf, PAGE_SIZE);
 	if (retval < 0)
 		goto out_unlock;
 	seq_puts(m, buf);
Signature · 3 lines
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <[email protected]> 1.650.933.1373