summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorye xingchen <ye.xingchen@zte.com.cn>2022-08-26 10:29:03 +0300
committerHuacai Chen <chenhuacai@loongson.cn>2022-09-03 13:01:27 +0300
commitac9284db6b7b4af150940186b633a233d4ca2bed (patch)
tree9e79521bf1587650f5ed056d83e42c6c04704604
parent1a470ce4e9106cc4c3c0edfb2e213dcbb7224dc4 (diff)
downloadlinux-ac9284db6b7b4af150940186b633a233d4ca2bed.tar.xz
LoongArch: mm: Remove the unneeded result variable
Return the value pa_to_nid() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
-rw-r--r--arch/loongarch/mm/init.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/loongarch/mm/init.c b/arch/loongarch/mm/init.c
index 3c3fbff0b8f8..0532ed5ba43d 100644
--- a/arch/loongarch/mm/init.c
+++ b/arch/loongarch/mm/init.c
@@ -146,10 +146,7 @@ void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
#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