From: shiliyang <shiliyang@huawei.com>
To: Warner Losh <imp@bsdimp.com>, Peter Maydell <peter.maydell@linaro.org>
Cc: alex.chen@huawei.com, hunongda@huawei.com,
QEMU Developers <qemu-devel@nongnu.org>
Subject: [PATCH V4 2/4] bsd-user: suspect code indent for conditional statements
Date: Mon, 18 Jan 2021 10:20:10 +0800 [thread overview]
Message-ID: <ab18c75a-05f4-43f3-dbac-2c734201dc02@huawei.com> (raw)
In-Reply-To: <c75512b3-0665-d686-5ea4-248a9819355d@huawei.com>
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
next prev parent reply other threads:[~2021-01-18 2:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-18 2:17 [PATCH V4 0/4] bsd-user: Fix some code style problems shiliyang
2021-01-18 2:19 ` [PATCH V4 1/4] bsd-user: "foo * bar" should be "foo *bar" shiliyang
2021-01-18 2:20 ` shiliyang [this message]
2021-01-18 2:20 ` [PATCH V4 3/4] bsd-user: do not use C99 // comments shiliyang
2021-01-18 2:37 ` Warner Losh
2021-01-18 2:21 ` [PATCH V4 4/4] bsd-user: space required after semicolon shiliyang
2021-01-18 2:35 ` Warner Losh
2021-01-21 3:10 ` shiliyang
2021-01-18 2:37 ` [PATCH V4 0/4] bsd-user: Fix some code style problems Warner Losh
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=ab18c75a-05f4-43f3-dbac-2c734201dc02@huawei.com \
--to=shiliyang@huawei.com \
--cc=alex.chen@huawei.com \
--cc=hunongda@huawei.com \
--cc=imp@bsdimp.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).