qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: stefanha@redhat.com, "Bibo Mao" <maobibo@loongson.cn>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 7/8] target/loongarch: Remove unnecessary temporary variable assignment
Date: Fri, 21 Mar 2025 15:51:57 +0100	[thread overview]
Message-ID: <20250321145158.3896812-8-armbru@redhat.com> (raw)
In-Reply-To: <20250321145158.3896812-1-armbru@redhat.com>

From: Bibo Mao <maobibo@loongson.cn>

Temporary variable ret is assigned at last line and return, it can
be removed and return directly.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250320032158.1762751-6-maobibo@loongson.cn>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 target/loongarch/tcg/tlb_helper.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/target/loongarch/tcg/tlb_helper.c b/target/loongarch/tcg/tlb_helper.c
index 646dbf59de..182881a237 100644
--- a/target/loongarch/tcg/tlb_helper.c
+++ b/target/loongarch/tcg/tlb_helper.c
@@ -543,7 +543,7 @@ target_ulong helper_lddir(CPULoongArchState *env, target_ulong base,
                           target_ulong level, uint32_t mem_idx)
 {
     CPUState *cs = env_cpu(env);
-    target_ulong badvaddr, index, phys, ret;
+    target_ulong badvaddr, index, phys;
     uint64_t dir_base, dir_width;
 
     if (unlikely((level == 0) || (level > 4))) {
@@ -571,8 +571,7 @@ target_ulong helper_lddir(CPULoongArchState *env, target_ulong base,
     get_dir_base_width(env, &dir_base, &dir_width, level);
     index = (badvaddr >> dir_base) & ((1 << dir_width) - 1);
     phys = base | index << 3;
-    ret = ldq_phys(cs->as, phys) & TARGET_PHYS_MASK;
-    return ret;
+    return ldq_phys(cs->as, phys) & TARGET_PHYS_MASK;
 }
 
 void helper_ldpte(CPULoongArchState *env, target_ulong base, target_ulong odd,
-- 
2.48.1



  parent reply	other threads:[~2025-03-21 14:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-21 14:51 [PULL 0/8] Error reporting patches for 2025-03-21 Markus Armbruster
2025-03-21 14:51 ` [PULL 1/8] cryptodev: Fix error handling in cryptodev_lkcf_execute_task() Markus Armbruster
2025-03-21 14:51 ` [PULL 2/8] error: Strip trailing '\n' from an error string argument Markus Armbruster
2025-03-21 14:51 ` [PULL 3/8] hw/xen: Fix xen_bus_realize() error handling Markus Armbruster
2025-03-21 14:51 ` [PULL 4/8] hw/xen: Downgrade a xen_bus_realize() non-error to warning Markus Armbruster
2025-03-21 14:51 ` [PULL 5/8] target/loongarch: Fix error handling of KVM feature checks Markus Armbruster
2025-03-21 14:51 ` [PULL 6/8] hw/loongarch/virt: Eliminate error_propagate() Markus Armbruster
2025-03-21 14:51 ` Markus Armbruster [this message]
2025-03-21 14:51 ` [PULL 8/8] target/loongarch: Clean up virt_cpu_irq_init() error handling Markus Armbruster
2025-03-23 22:29 ` [PULL 0/8] Error reporting patches for 2025-03-21 Stefan Hajnoczi

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=20250321145158.3896812-8-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=maobibo@loongson.cn \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).