Skip to content

Commit 5fda1bd

Browse files
prarittorvalds
authored andcommitted
mm: notifier_from_errno() cleanup
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]>
1 parent cbf978b commit 5fda1bd

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

mm/page_cgroup.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,7 @@ static int __meminit page_cgroup_callback(struct notifier_block *self,
243243
break;
244244
}
245245

246-
if (ret)
247-
ret = notifier_from_errno(ret);
248-
else
249-
ret = NOTIFY_OK;
250-
251-
return ret;
246+
return notifier_from_errno(ret);
252247
}
253248

254249
#endif

mm/slab.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,7 @@ static int __meminit slab_memory_callback(struct notifier_block *self,
13901390
break;
13911391
}
13921392
out:
1393-
return ret ? notifier_from_errno(ret) : NOTIFY_OK;
1393+
return notifier_from_errno(ret);
13941394
}
13951395
#endif /* CONFIG_NUMA && CONFIG_MEMORY_HOTPLUG */
13961396

0 commit comments

Comments
 (0)