mm: notifier_from_errno() cleanup
authorPrarit Bhargava <prarit@redhat.com>
Tue, 22 Mar 2011 23:30:49 +0000 (16:30 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 23 Mar 2011 00:44:01 +0000 (17:44 -0700)
While looking at some other notifier callbacks I noticed this code could
use a simple cleanup.

notifier_from_errno() no longer needs the if (ret)/else conditional.  That
same conditional is now done in notifier_from_errno().

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Paul Menage <menage@google.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page_cgroup.c
mm/slab.c

index 5bffada..59a3cd4 100644 (file)
@@ -243,12 +243,7 @@ static int __meminit page_cgroup_callback(struct notifier_block *self,
                break;
        }
 
-       if (ret)
-               ret = notifier_from_errno(ret);
-       else
-               ret = NOTIFY_OK;
-
-       return ret;
+       return notifier_from_errno(ret);
 }
 
 #endif
index a18ba57..568803f 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1390,7 +1390,7 @@ static int __meminit slab_memory_callback(struct notifier_block *self,
                break;
        }
 out:
-       return ret ? notifier_from_errno(ret) : NOTIFY_OK;
+       return notifier_from_errno(ret);
 }
 #endif /* CONFIG_NUMA && CONFIG_MEMORY_HOTPLUG */