All of lore.kernel.org
 help / color / mirror / Atom feed
From: cgel.zte@gmail.com
To: chenhuacai@kernel.org
Cc: kernel@xen0n.name, jiaxun.yang@flygoat.com,
	loongarch@lists.linux.dev, ye xingchen <ye.xingchen@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: [PATCH linux-next] LoongArch: mm: Remove the unneeded result variable
Date: Fri, 26 Aug 2022 07:29:03 +0000	[thread overview]
Message-ID: <20220826072903.253230-1-ye.xingchen@zte.com.cn> (raw)

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

             reply	other threads:[~2022-08-26  7:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26  7:29 cgel.zte [this message]
2022-09-04 12:14 ` [PATCH linux-next] LoongArch: mm: Remove the unneeded result variable Huacai Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220826072903.253230-1-ye.xingchen@zte.com.cn \
    --to=cgel.zte@gmail.com \
    --cc=chenhuacai@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kernel@xen0n.name \
    --cc=loongarch@lists.linux.dev \
    --cc=ye.xingchen@zte.com.cn \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.