[PATCH] mm/memblock: simplify reserve_mem_init error handling

Hongfu Li <[email protected]>
Newsgroups org.kvack.linux-mm,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
From: Hongfu Li <[email protected]>

Return prepare_kho_fdt() directly instead of assigning to a local and
returning it on both success and failure paths.

Signed-off-by: Hongfu Li <[email protected]>
---
 mm/memblock.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index 777c69f05400..7079b93ec730 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -2616,15 +2616,10 @@ static int __init prepare_kho_fdt(void)
 
 static int __init reserve_mem_init(void)
 {
-	int err;
-
 	if (!kho_is_enabled() || !reserved_mem_count)
 		return 0;
 
-	err = prepare_kho_fdt();
-	if (err)
-		return err;
-	return err;
+	return prepare_kho_fdt();
 }
 late_initcall(reserve_mem_init);
 
-- 
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.