staging: android/lowmemorykiller: No need for task->signal check
authorAnton Vorontsov <anton.vorontsov@linaro.org>
Mon, 6 Feb 2012 16:29:54 +0000 (20:29 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2012 00:55:46 +0000 (16:55 -0800)
task->signal == NULL is not possible, so no need for these checks.

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/lowmemorykiller.c

index 0755e2f0eb18fd4ec1935a629e6d62cbcc3e975c..6e800d35ebdaf7032233bb8bcb839700d66985d0 100644 (file)
@@ -136,19 +136,13 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
        rcu_read_lock();
        for_each_process(tsk) {
                struct task_struct *p;
-               struct signal_struct *sig;
                int oom_adj;
 
                p = find_lock_task_mm(tsk);
                if (!p)
                        continue;
 
-               sig = p->signal;
-               if (!sig) {
-                       task_unlock(p);
-                       continue;
-               }
-               oom_adj = sig->oom_adj;
+               oom_adj = p->signal->oom_adj;
                if (oom_adj < min_adj) {
                        task_unlock(p);
                        continue;