Skip to content

Commit

Permalink
powerpc/pseries/cmm: Cleanup rc handling in cmm_init()
Browse files Browse the repository at this point in the history
No need to initialize rc. Also, let's return 0 directly when
succeeding.

Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191031142933.10779-4-david@redhat.com
  • Loading branch information
David Hildenbrand authored and Michael Ellerman committed Nov 13, 2019
1 parent 022da22 commit 68f7a04
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions arch/powerpc/platforms/pseries/cmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ static struct notifier_block cmm_mem_nb = {
**/
static int cmm_init(void)
{
int rc = -ENOMEM;
int rc;

if (!firmware_has_feature(FW_FEATURE_CMO))
return -EOPNOTSUPP;
Expand All @@ -692,16 +692,15 @@ static int cmm_init(void)
goto out_unregister_notifier;

if (cmm_disabled)
return rc;
return 0;

cmm_thread_ptr = kthread_run(cmm_thread, NULL, "cmmthread");
if (IS_ERR(cmm_thread_ptr)) {
rc = PTR_ERR(cmm_thread_ptr);
goto out_unregister_notifier;
}

return rc;

return 0;
out_unregister_notifier:
unregister_memory_notifier(&cmm_mem_nb);
unregister_memory_isolate_notifier(&cmm_mem_isolate_nb);
Expand Down

0 comments on commit 68f7a04

Please sign in to comment.