Skip to content

Commit

Permalink
mm: notifier_from_errno() cleanup
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Paul Menage <[email protected]>
Cc: Li Zefan <[email protected]>
Acked-by: Pekka Enberg <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
prarit authored and torvalds committed Mar 23, 2011
1 parent cbf978b commit 5fda1bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions mm/page_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down

0 comments on commit 5fda1bd

Please sign in to comment.