]> git.baikalelectronics.ru Git - kernel.git/commitdiff
LoongArch: mm: Remove the unneeded result variable
authorye xingchen <ye.xingchen@zte.com.cn>
Fri, 26 Aug 2022 07:29:03 +0000 (07:29 +0000)
committerHuacai Chen <chenhuacai@loongson.cn>
Sat, 3 Sep 2022 10:01:27 +0000 (18:01 +0800)
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>
arch/loongarch/mm/init.c

index 3c3fbff0b8f8648c680a7dc377a108bd5e022cd7..0532ed5ba43de5aeb646083d587bcc71a3ece828 100644 (file)
@@ -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