All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 01/24] bsd-user: whitespace changes
@ 2021-04-23 20:39 imp
  2021-04-23 20:39 ` [PULL 02/24] " imp
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: imp @ 2021-04-23 20:39 UTC (permalink / raw)
  To: qemu-devel; +Cc: kevans, arichardson, Warner Losh

From: Warner Losh <imp@bsdimp.com>

keyword space paren, no space before ( in function calls, spaces around
operators.

Signed-off-by: Warner Losh <imp@bsdimp.com>
---
 bsd-user/bsdload.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c
index f38c4faacf..2bacae7393 100644
--- a/bsd-user/bsdload.c
+++ b/bsd-user/bsdload.c
@@ -24,7 +24,7 @@ static int count(char ** vec)
 {
     int         i;
 
-    for(i = 0; *vec; i++) {
+    for (i = 0; *vec; i++) {
         vec++;
     }
 
@@ -37,15 +37,15 @@ static int prepare_binprm(struct linux_binprm *bprm)
     int mode;
     int retval;
 
-    if(fstat(bprm->fd, &st) < 0) {
+    if (fstat(bprm->fd, &st) < 0) {
         return(-errno);
     }
 
     mode = st.st_mode;
-    if(!S_ISREG(mode)) {        /* Must be regular file */
+    if (!S_ISREG(mode)) {        /* Must be regular file */
         return(-EACCES);
     }
-    if(!(mode & 0111)) {        /* Must have at least one execute bit set */
+    if (!(mode & 0111)) {        /* Must have at least one execute bit set */
         return(-EACCES);
     }
 
@@ -53,7 +53,7 @@ static int prepare_binprm(struct linux_binprm *bprm)
     bprm->e_gid = getegid();
 
     /* Set-uid? */
-    if(mode & S_ISUID) {
+    if (mode & S_ISUID) {
         bprm->e_uid = st.st_uid;
     }
 
@@ -69,10 +69,10 @@ static int prepare_binprm(struct linux_binprm *bprm)
 
     memset(bprm->buf, 0, sizeof(bprm->buf));
     retval = lseek(bprm->fd, 0L, SEEK_SET);
-    if(retval >= 0) {
+    if (retval >= 0) {
         retval = read(bprm->fd, bprm->buf, 128);
     }
-    if(retval < 0) {
+    if (retval < 0) {
         perror("prepare_binprm");
         exit(-1);
         /* return(-errno); */
@@ -132,8 +132,8 @@ int loader_exec(const char * filename, char ** argv, char ** envp,
     int retval;
     int i;
 
-    bprm.p = TARGET_PAGE_SIZE*MAX_ARG_PAGES-sizeof(unsigned int);
-    for (i=0 ; i<MAX_ARG_PAGES ; i++)       /* clear page-table */
+    bprm.p = TARGET_PAGE_SIZE * MAX_ARG_PAGES - sizeof(unsigned int);
+    for (i = 0 ; i < MAX_ARG_PAGES ; i++)       /* clear page-table */
             bprm.page[i] = NULL;
     retval = open(filename, O_RDONLY);
     if (retval < 0)
@@ -147,26 +147,26 @@ int loader_exec(const char * filename, char ** argv, char ** envp,
 
     retval = prepare_binprm(&bprm);
 
-    if(retval>=0) {
+    if (retval >= 0) {
         if (bprm.buf[0] == 0x7f
                 && bprm.buf[1] == 'E'
                 && bprm.buf[2] == 'L'
                 && bprm.buf[3] == 'F') {
-            retval = load_elf_binary(&bprm,regs,infop);
+            retval = load_elf_binary(&bprm, regs, infop);
         } else {
             fprintf(stderr, "Unknown binary format\n");
             return -1;
         }
     }
 
-    if(retval>=0) {
+    if (retval >= 0) {
         /* success.  Initialize important registers */
         do_init_thread(regs, infop);
         return retval;
     }
 
     /* Something went wrong, return the inode and free the argument pages*/
-    for (i=0 ; i<MAX_ARG_PAGES ; i++) {
+    for (i = 0 ; i < MAX_ARG_PAGES ; i++) {
         g_free(bprm.page[i]);
     }
     return(retval);
-- 
2.22.1



^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-04-23 23:10 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 20:39 [PULL 01/24] bsd-user: whitespace changes imp
2021-04-23 20:39 ` [PULL 02/24] " imp
2021-04-23 23:02   ` Richard Henderson
2021-04-23 20:39 ` [PULL 03/24] " imp
2021-04-23 23:03   ` Richard Henderson
2021-04-23 20:39 ` [PULL 04/24] bsd-user: style tweak: keyword space ( imp
2021-04-23 23:03   ` Richard Henderson
2021-04-23 20:39 ` [PULL 05/24] " imp
2021-04-23 23:03   ` Richard Henderson
2021-04-23 20:39 ` [PULL 06/24] " imp
2021-04-23 23:03   ` Richard Henderson
2021-04-23 20:39 ` [PULL 07/24] " imp
2021-04-23 23:03   ` Richard Henderson
2021-04-23 20:39 ` [PULL 08/24] bsd-user: style tweak: use C not C++ comments imp
2021-04-23 23:04   ` Richard Henderson
2021-04-23 20:39 ` [PULL 09/24] " imp
2021-04-23 23:04   ` Richard Henderson
2021-04-23 23:02 ` [PULL 01/24] bsd-user: whitespace changes Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.