qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: marcandre.lureau@redhat.com
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [PULL 03/21] m68k/nios2-semi: fix gettimeofday() result check
Date: Tue, 22 Mar 2022 16:25:43 +0400	[thread overview]
Message-ID: <20220322122601.927238-4-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20220322122601.927238-1-marcandre.lureau@redhat.com>

From: Marc-André Lureau <marcandre.lureau@redhat.com>

gettimeofday() returns 0 for success.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/m68k/m68k-semi.c   | 2 +-
 target/nios2/nios2-semi.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c
index 44ec7e4612c6..c5c164e096c8 100644
--- a/target/m68k/m68k-semi.c
+++ b/target/m68k/m68k-semi.c
@@ -381,7 +381,7 @@ void do_m68k_semihosting(CPUM68KState *env, int nr)
             qemu_timeval tv;
             struct gdb_timeval *p;
             result = qemu_gettimeofday(&tv);
-            if (result != 0) {
+            if (result == 0) {
                 if (!(p = lock_user(VERIFY_WRITE,
                                     arg0, sizeof(struct gdb_timeval), 0))) {
                     /* FIXME - check error code? */
diff --git a/target/nios2/nios2-semi.c b/target/nios2/nios2-semi.c
index fe5598bae4d7..5a7ad0c7108d 100644
--- a/target/nios2/nios2-semi.c
+++ b/target/nios2/nios2-semi.c
@@ -403,7 +403,7 @@ void do_nios2_semihosting(CPUNios2State *env)
             qemu_timeval tv;
             struct gdb_timeval *p;
             result = qemu_gettimeofday(&tv);
-            if (result != 0) {
+            if (result == 0) {
                 p = lock_user(VERIFY_WRITE, arg0, sizeof(struct gdb_timeval),
                               0);
                 if (!p) {
-- 
2.35.1.273.ge6ebfd0e8cbb



  parent reply	other threads:[~2022-03-22 12:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22 12:25 [PULL 00/21] Fixes patches marcandre.lureau
2022-03-22 12:25 ` [PULL 01/21] qemu-options: define -spice only #ifdef CONFIG_SPICE marcandre.lureau
2022-03-22 12:25 ` [PULL 02/21] vl: typo fix in a comment marcandre.lureau
2022-03-22 12:25 ` marcandre.lureau [this message]
2022-03-22 12:25 ` [PULL 04/21] Drop qemu_foo() socket API wrapper marcandre.lureau
2022-03-22 12:25 ` [PULL 05/21] Replace GCC_FMT_ATTR with G_GNUC_PRINTF marcandre.lureau
2022-03-22 12:25 ` [PULL 06/21] compiler.h: replace QEMU_WARN_UNUSED_RESULT with G_GNUC_WARN_UNUSED_RESULT marcandre.lureau
2022-03-22 12:25 ` [PULL 07/21] compiler.h: replace QEMU_SENTINEL with G_GNUC_NULL_TERMINATED marcandre.lureau
2022-03-22 12:25 ` [PULL 08/21] Simplify HOST_LONG_BITS marcandre.lureau
2022-03-22 12:25 ` [PULL 09/21] Move HOST_LONG_BITS to compiler.h marcandre.lureau
2022-03-22 12:25 ` [PULL 10/21] scripts/modinfo-collect: remove unused/dead code marcandre.lureau
2022-03-22 12:25 ` [PULL 11/21] util: remove needless includes marcandre.lureau
2022-03-22 12:25 ` [PULL 12/21] util: remove the net/net.h dependency marcandre.lureau
2022-03-22 12:25 ` [PULL 13/21] qapi: remove needless include marcandre.lureau
2022-03-22 12:25 ` [PULL 14/21] meson: move int128 checks from configure marcandre.lureau
2022-03-22 12:25 ` [PULL 15/21] meson: fix CONFIG_ATOMIC128 check marcandre.lureau
2022-03-22 12:25 ` [PULL 16/21] qapi: remove needless include marcandre.lureau
2022-03-22 12:25 ` [PULL 17/21] qga: remove bswap.h include marcandre.lureau
2022-03-22 12:25 ` [PULL 18/21] error: use GLib to remember the program name marcandre.lureau
2022-03-22 12:25 ` [PULL 19/21] tests: remove needless include marcandre.lureau
2022-03-22 12:26 ` [PULL 20/21] Remove trailing ; after G_DEFINE_AUTO macro marcandre.lureau
2022-03-22 12:26 ` [PULL 21/21] qapi: remove needless include marcandre.lureau
2022-03-22 20:45 ` [PULL 00/21] Fixes patches Peter Maydell

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=20220322122601.927238-4-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=peter.maydell@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).