Skip to contentSkip to conversation

LoongArch: mm: Remove the unneeded result variable

PATCH Applied [email protected] 2 participants 2 messages Aug 26, 2022 – Sep 4, 2022 LoongArch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 LoongArch: mm: Remove the unneeded result variable

From: ye xingchen <[email protected]>

Return the value pa_to_nid() directly instead of storing it in another redundant variable.

---
 arch/loongarch/mm/init.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/loongarch/mm/init.c +1 -4
index 7094a68c9b83..f05149aa6a37 100644
@@ -134,10 +134,7 @@ int arch_add_memory(int nid, u64 start, u64 size, struct mhp_params *params)
 #ifdef CONFIG_NUMA
 int memory_add_physaddr_to_nid(u64 start)
 {
-	int nid;
-
-	nid = pa_to_nid(start);
-	return nid;
+	return pa_to_nid(start);
 }
 EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
 #endif
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw

Applied to loongarch-fixes, thanks.

Huacai

Quoted 30 lines · On Fri, Aug 26, 2022 at 3:29 PM <[email protected]> wrote:

From: ye xingchen <[email protected]>

Return the value pa_to_nid() directly instead of storing it in another redundant variable.

---
 arch/loongarch/mm/init.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/loongarch/mm/init.c +1 -5
index 7094a68c9b83..f05149aa6a37 100644
@@ -134,10 +134,7 @@ int arch_add_memory(int nid, u64 start, u64 size, struct mhp_params *params)
 #ifdef CONFIG_NUMA
 int memory_add_physaddr_to_nid(u64 start)
 {
-       int nid;
-
-       nid = pa_to_nid(start);
-       return nid;
+       return pa_to_nid(start);
 }
 EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
 #endif
--

2.25.1