aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorye xingchen <ye.xingchen@zte.com.cn>2022-08-26 07:29:03 +0000
committerHuacai Chen <chenhuacai@loongson.cn>2022-09-03 18:01:27 +0800
commitac9284db6b7b4af150940186b633a233d4ca2bed (patch)
tree9e79521bf1587650f5ed056d83e42c6c04704604 /arch
parentLoongArch: Fix arch_remove_memory() undefined build error (diff)
downloadlinux-dev-ac9284db6b7b4af150940186b633a233d4ca2bed.tar.xz
linux-dev-ac9284db6b7b4af150940186b633a233d4ca2bed.zip
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>
Diffstat (limited to 'arch')
-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