From: Warner Losh <imp@bsdimp.com>
To: qemu-devel@nongnu.org
Cc: kevans@freebsd.org,
Richard Henderson <richard.henderson@linaro.org>,
Warner Losh <imp@bsdimp.com>
Subject: [PULL 5/5] bsd-user: style tweak: Put {} around all if/else/for statements
Date: Fri, 30 Apr 2021 11:27:46 -0600 [thread overview]
Message-ID: <20210430172746.99818-6-imp@bsdimp.com> (raw)
In-Reply-To: <20210430172746.99818-1-imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/bsdload.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c
index fd14ffa4cd..e1ed3b7b60 100644
--- a/bsd-user/bsdload.c
+++ b/bsd-user/bsdload.c
@@ -13,8 +13,9 @@ abi_long memcpy_to_target(abi_ulong dest, const void *src,
void *host_ptr;
host_ptr = lock_user(VERIFY_WRITE, dest, len, 0);
- if (!host_ptr)
+ if (!host_ptr) {
return -TARGET_EFAULT;
+ }
memcpy(host_ptr, src, len);
unlock_user(host_ptr, dest, 1);
return 0;
@@ -75,8 +76,7 @@ static int prepare_binprm(struct linux_binprm *bprm)
if (retval < 0) {
perror("prepare_binprm");
exit(-1);
- }
- else {
+ } else {
return retval;
}
}
@@ -132,11 +132,13 @@ int loader_exec(const char *filename, char **argv, char **envp,
int i;
bprm.p = TARGET_PAGE_SIZE * MAX_ARG_PAGES - sizeof(unsigned int);
- for (i = 0 ; i < MAX_ARG_PAGES ; i++) /* clear page-table */
+ for (i = 0 ; i < MAX_ARG_PAGES ; i++) { /* clear page-table */
bprm.page[i] = NULL;
+ }
retval = open(filename, O_RDONLY);
- if (retval < 0)
+ if (retval < 0) {
return retval;
+ }
bprm.fd = retval;
bprm.filename = (char *)filename;
bprm.argc = count(argv);
--
2.22.1
next prev parent reply other threads:[~2021-04-30 17:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-30 17:27 [PULL 0/5] bsd-user: minor cleanup patches Warner Losh
2021-04-30 17:27 ` [PULL 1/5] bsd-user: whitespace changes Warner Losh
2021-04-30 17:27 ` [PULL 2/5] bsd-user: style tweak: keyword space ( Warner Losh
2021-04-30 17:27 ` [PULL 3/5] bsd-user: style tweak: return is not a function, eliminate () Warner Losh
2021-04-30 17:27 ` [PULL 4/5] bsd-user: put back a break; that had gone missing Warner Losh
2021-04-30 17:27 ` Warner Losh [this message]
2021-05-04 16:04 ` [PULL 0/5] bsd-user: minor cleanup 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=20210430172746.99818-6-imp@bsdimp.com \
--to=imp@bsdimp.com \
--cc=kevans@freebsd.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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).