All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] LoongArch: mm: Remove the unneeded result variable
@ 2022-08-26  7:29 cgel.zte
  2022-09-04 12:14 ` Huacai Chen
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-08-26  7:29 UTC (permalink / raw)
  To: chenhuacai; +Cc: kernel, jiaxun.yang, loongarch, ye xingchen, Zeal Robot

From: ye xingchen <ye.xingchen@zte.com.cn>

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>
---
 arch/loongarch/mm/init.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/loongarch/mm/init.c b/arch/loongarch/mm/init.c
index 7094a68c9b83..f05149aa6a37 100644
--- a/arch/loongarch/mm/init.c
+++ b/arch/loongarch/mm/init.c
@@ -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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-04 12:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26  7:29 [PATCH linux-next] LoongArch: mm: Remove the unneeded result variable cgel.zte
2022-09-04 12:14 ` Huacai Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.