[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 16/48] bsd-user: style tweak: Put {} around all if/else/for st
From: |
imp |
Subject: |
[PATCH v2 16/48] bsd-user: style tweak: Put {} around all if/else/for statements |
Date: |
Sat, 24 Apr 2021 09:59:44 -0600 |
From: Warner Losh <imp@bsdimp.com>
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
- Re: [PATCH v2 14/48] bsd-user: style tweak: Remove #if 0'd code, (continued)
- [PATCH v2 22/48] bsd-user: use qemu_strtoul in preference to strtol, imp, 2021/04/24
- [PATCH v2 10/48] bsd-user: Remove commented out code, imp, 2021/04/24
- [PATCH v2 24/48] bsd-user: create target_arch_cpu.h, imp, 2021/04/24
- [PATCH v2 32/48] bsd-user: style tweak: remove spacing after '*' and add after }, imp, 2021/04/24
- [PATCH v2 28/48] bsd-user: style tweak: comments, imp, 2021/04/24
- [PATCH v2 16/48] bsd-user: style tweak: Put {} around all if/else/for statements,
imp <=
- [PATCH v2 18/48] bsd-user: style tweak: Use preferred block comments, imp, 2021/04/24
- [PATCH v2 33/48] bsd-user: style tweak: Use preferred block comments, imp, 2021/04/24
- [PATCH v2 37/48] bsd-user: style tweak: don't assign in if statements, imp, 2021/04/24
- [PATCH v2 41/48] bsd-user: style tweak: don't assign in if statements, imp, 2021/04/24
- [PATCH v2 40/48] bsd-user: style tweak: Use preferred block comments, imp, 2021/04/24