Skip to contentSkip to conversation

linux-user: Do not call get_errno() in do_brk()

PATCH In review Nathan Egge 2 participants 2 messages Aug 4, 2023 – Aug 5, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v9 7/24 linux-user: Do not call get_errno() in do_brk()

Quoted 33 lines · Richard Henderson

From: Akihiko Odaki <[email protected]>

Later the returned value is compared with -1, and negated errno is not expected.

Fixes 00faf08c95 ("linux-user: Don't use MAP_FIXED in do_brk()")

Message-Id: <[email protected]>

---
 linux-user/syscall.c | 6 +++---

 1 file changed, 3 insertions(+), 3 deletions(-)
linux-user/syscall.c +3 -3
index 95727a816a..b9d2ec02f9 100644
@@ -862,9 +862,9 @@ abi_long do_brk(abi_ulong brk_val)
       */
      if (new_host_brk_page > brk_page) {
          new_alloc_size = new_host_brk_page - brk_page;
-        mapped_addr = get_errno(target_mmap(brk_page, new_alloc_size,
-                                        PROT_READ|PROT_WRITE,
-                                        MAP_ANON|MAP_PRIVATE, 0, 0));
+        mapped_addr = target_mmap(brk_page, new_alloc_size,
+                                  PROT_READ|PROT_WRITE,
+                                  MAP_ANON|MAP_PRIVATE, 0, 0);
      } else {
          new_alloc_size = 0;
          mapped_addr = brk_page;
Signature · 1 line
2.34.1

This patch is triggering a gitlab pipeline failure in Richard's tcg-next branch:

https://gitlab.com/rth7680/qemu/-/pipelines/956532662

It can be reproduced locally by adding a git remote for rth7680 and then running:

$ git checkout rth7680/tcg-next
$ .gitlab-ci.d/check-patch.py

Checking all commits since c26d005e62f4fd177dae0cd70c24cb96761edebc...

f7cca41b17c809958a7f04b7d7f64af40d64e645:31: ERROR: spaces required around that '|' (ctx:VxV) f7cca41b17c809958a7f04b7d7f64af40d64e645:32: ERROR: spaces required around that '|' (ctx:VxV)
total: 2 errors, 0 warnings, 12 lines checked
    ❌ FAIL one or more commits failed scripts/checkpatch.pl

The linux-user/syscall.c has many such places where this style check is failing. Should these be fixed in a separate patch?

Sincerely,

Nathan

#1 lore raw
Quoted 1 line · Nathan Egge

The linux-user/syscall.c has many such places where this style check is failing. Should these be fixed in a separate patch?

Yes, eventually.

r~