qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andrew.Yuan" <andrew.yuan@jaguarmicro.com>
To: philmd@linaro.org, dbarboza@ventanamicro.com,
	alistair.francis@wdc.com, pbonzini@redhat.com,
	qemu-devel@nongnu.org
Cc: "Andrew.Yuan" <andrew.yuan@jaguarmicro.com>
Subject: [PATCH] Remove unnecessary code in the interface accel_system_init_ops_interfaces
Date: Mon,  9 Sep 2024 11:17:36 +0800	[thread overview]
Message-ID: <20240909031736.1881-1-andrew.yuan@jaguarmicro.com> (raw)

The code 'ops = ACCEL_OPS_CLASS(module_object_class_by_name(ops_name));' is unnecessary;

And, the following code :
1.has the same functionality;
2.includes error checking;

Signed-off-by: Andrew.Yuan <andrew.yuan@jaguarmicro.com>
---
 accel/accel-system.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/accel/accel-system.c b/accel/accel-system.c
index f6c947dd82..5d502c8fd8 100644
--- a/accel/accel-system.c
+++ b/accel/accel-system.c
@@ -73,7 +73,7 @@ void accel_system_init_ops_interfaces(AccelClass *ac)
     g_assert(ac_name != NULL);
 
     ops_name = g_strdup_printf("%s" ACCEL_OPS_SUFFIX, ac_name);
-    ops = ACCEL_OPS_CLASS(module_object_class_by_name(ops_name));
+
     oc = module_object_class_by_name(ops_name);
     if (!oc) {
         error_report("fatal: could not load module for type '%s'", ops_name);
-- 
2.37.0.windows.1



             reply	other threads:[~2024-09-09  3:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-09  3:17 Andrew.Yuan [this message]
2024-09-09  9:54 ` [PATCH] Remove unnecessary code in the interface accel_system_init_ops_interfaces Daniel Henrique Barboza
2024-09-09 10:07   ` Claudio Fontana
2024-09-11 16:34     ` Claudio Fontana

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=20240909031736.1881-1-andrew.yuan@jaguarmicro.com \
    --to=andrew.yuan@jaguarmicro.com \
    --cc=alistair.francis@wdc.com \
    --cc=dbarboza@ventanamicro.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).