qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH V4 2/4] bsd-user: suspect code indent for conditional statements


From: shiliyang
Subject: [PATCH V4 2/4] bsd-user: suspect code indent for conditional statements
Date: Mon, 18 Jan 2021 10:20:10 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0

This patch fixes error style problems found by checkpatch.pl:
ERROR: suspect code indent for conditional statements

Signed-off-by: Liyang Shi <shiliyang@huawei.com>
---
 bsd-user/elfload.c |  2 +-
 bsd-user/mmap.c    | 25 +++++++++++++------------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
index 4d1a572534..d5cab25607 100644
--- a/bsd-user/elfload.c
+++ b/bsd-user/elfload.c
@@ -765,7 +765,7 @@ int load_elf_binary(struct bsd_binprm *bprm, struct 
target_pt_regs *regs,
         /* Now figure out which format our binary is */
         if ((N_MAGIC(interp_ex) != OMAGIC) && (N_MAGIC(interp_ex) != ZMAGIC) &&
                 (N_MAGIC(interp_ex) != QMAGIC)) {
-          interpreter_type = INTERPRETER_ELF;
+            interpreter_type = INTERPRETER_ELF;
         }

         if (interp_elf_ex.e_ident[0] != 0x7f ||
diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c
index 1b8c8382ca..785655f319 100644
--- a/bsd-user/mmap.c
+++ b/bsd-user/mmap.c
@@ -487,18 +487,19 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int 
prot,
        up to the targets page boundary.  */

     if ((qemu_real_host_page_size < qemu_host_page_size) && fd != -1) {
-       struct stat sb;
-
-       if (fstat (fd, &sb) == -1)
-           goto fail;
-
-       /* Are we trying to create a map beyond EOF?.  */
-       if (offset + len > sb.st_size) {
-           /* If so, truncate the file map at eof aligned with
-              the hosts real pagesize. Additional anonymous maps
-              will be created beyond EOF.  */
-           len = REAL_HOST_PAGE_ALIGN(sb.st_size - offset);
-       }
+        struct stat sb;
+
+        if (fstat(fd, &sb) == -1) {
+            goto fail;
+        }
+
+        /* Are we trying to create a map beyond EOF?.  */
+        if (offset + len > sb.st_size) {
+            /* If so, truncate the file map at eof aligned with
+               the hosts real pagesize. Additional anonymous maps
+               will be created beyond EOF.  */
+            len = REAL_HOST_PAGE_ALIGN(sb.st_size - offset);
+        }
     }

     if (!(flags & MAP_FIXED)) {
-- 
2.29.1.59.gf9b6481aed




reply via email to

[Prev in Thread] Current Thread [Next in Thread]