LoongArch: mm: Remove the unneeded result variable
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.
Reported-by Zeal Robot <[email protected]>
Signed-off-by ye xingchen <[email protected]>
--- arch/loongarch/mm/init.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
arch/loongarch/mm/init.c +1 -4
@@ -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
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.Reported-by Zeal Robot <[email protected]>Signed-off-by ye xingchen <[email protected]>--- arch/loongarch/mm/init.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)arch/loongarch/mm/init.c +1
-5@@ -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