linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]: mm: notifier_from_errno() cleanup
@ 2011-01-12 14:17 Prarit Bhargava
  0 siblings, 0 replies; only message in thread
From: Prarit Bhargava @ 2011-01-12 14:17 UTC (permalink / raw)
  To: linux-mm; +Cc: lwoodman, dzickus, riel, Prarit Bhargava

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>

diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
index 5bffada..59a3cd4 100644
--- a/mm/page_cgroup.c
+++ b/mm/page_cgroup.c
@@ -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
diff --git a/mm/slab.c b/mm/slab.c
index 2640374..0164aa4 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1387,7 +1387,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 */
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-12 14:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-12 14:17 [PATCH]: mm: notifier_from_errno() cleanup Prarit Bhargava

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox