From patchwork Wed Sep 14 15:22:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 9331893 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 94EDC607FD for ; Wed, 14 Sep 2016 15:32:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84A642A150 for ; Wed, 14 Sep 2016 15:32:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78E9A2A155; Wed, 14 Sep 2016 15:32:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A90A72A150 for ; Wed, 14 Sep 2016 15:32:48 +0000 (UTC) Received: from localhost ([::1]:56840 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkCB5-0001aY-R9 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 14 Sep 2016 11:32:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkC4Z-0004sA-LD for qemu-devel@nongnu.org; Wed, 14 Sep 2016 11:26:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkC4X-000060-Nd for qemu-devel@nongnu.org; Wed, 14 Sep 2016 11:26:03 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:58133 helo=mail.rt-rk.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkC4X-00005m-82 for qemu-devel@nongnu.org; Wed, 14 Sep 2016 11:26:01 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 785131A2399; Wed, 14 Sep 2016 17:26:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from mcs19.domain.local (mcs19.domain.local [10.10.13.51]) by mail.rt-rk.com (Postfix) with ESMTPSA id 566BD1A1CFF; Wed, 14 Sep 2016 17:26:00 +0200 (CEST) From: Aleksandar Markovic To: qemu-devel@nongnu.org, riku.voipio@iki.fi, peter.maydell@linaro.org, petar.jovanovic@imgtec.com, miodrag.dinic@imgtec.com, aleksandar.rikalo@imgtec.com, aleksandar.markovic@imgtec.com Date: Wed, 14 Sep 2016 17:22:08 +0200 Message-Id: <20160914152224.122271-11-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160914152224.122271-1-aleksandar.markovic@rt-rk.com> References: <20160914152224.122271-1-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v4 10/11] linux-user: Improve usage of spaces in linux-user/main.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Aleksandar Markovic This patch removes all spaces-related errors (reported by checkpatch.pl) from linux-user/main.c. Signed-off-by: Aleksandar Markovic --- linux-user/main.c | 96 +++++++++++++++++++++++++++---------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 4c930e2..f4b4dc5 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -292,11 +292,11 @@ void cpu_loop(CPUX86State *env) abi_ulong ret; target_siginfo_t info; - for(;;) { + for (;;) { cpu_exec_start(cs); trapnr = cpu_exec(cs); cpu_exec_end(cs); - switch(trapnr) { + switch (trapnr) { case 0x80: /* linux syscall from int $0x80 */ ret = do_syscall(env, @@ -738,11 +738,11 @@ void cpu_loop(CPUARMState *env) uint32_t addr; abi_ulong ret; - for(;;) { + for (;;) { cpu_exec_start(cs); trapnr = cpu_exec(cs); cpu_exec_end(cs); - switch(trapnr) { + switch (trapnr) { case EXCP_UDEF: { TaskState *ts = cs->opaque; @@ -762,7 +762,7 @@ void cpu_loop(CPUARMState *env) info._sifields._sigfault._addr = env->regs[15]; queue_signal(env, info.si_signo, &info); } else if (rc < 0) { /* FP exception */ - int arm_fpe=0; + int arm_fpe = 0; /* translate softfloat flags to FPSR flags */ if (-rc & float_flag_invalid) { @@ -827,7 +827,7 @@ void cpu_loop(CPUARMState *env) if ((!(fpsr & BIT_IOE)) && (arm_fpe & BIT_IOC)) { fpsr |= BIT_IOC; } - ts->fpa.fpsr=fpsr; + ts->fpa.fpsr = fpsr; } else { /* everything OK */ /* increment PC */ env->regs[15] += 4; @@ -867,7 +867,7 @@ void cpu_loop(CPUARMState *env) /* nop */ } else if (n == ARM_NR_semihosting || n == ARM_NR_thumb_semihosting) { - env->regs[0] = do_arm_semihosting (env); + env->regs[0] = do_arm_semihosting(env); } else if (n == 0 || n >= ARM_SYSCALL_BASE || env->thumb) { /* linux syscall */ if (env->thumb || n == 0) { @@ -876,7 +876,7 @@ void cpu_loop(CPUARMState *env) n -= ARM_SYSCALL_BASE; env->eabi = 0; } - if ( n > ARM_NR_BASE) { + if (n > ARM_NR_BASE) { switch (n) { case ARM_NR_cacheflush: /* nop */ @@ -1291,7 +1291,7 @@ static inline void save_window_offset(CPUSPARCState *env, int cwp1) printf("win_overflow: sp_ptr=0x" TARGET_ABI_FMT_lx " save_cwp=%d\n", sp_ptr, cwp1); #endif - for(i = 0; i < 16; i++) { + for (i = 0; i < 16; i++) { /* FIXME - what to do if put_user() fails? */ put_user_ual(env->regbase[get_reg_index(env, cwp1, 8 + i)], sp_ptr); sp_ptr += sizeof(abi_ulong); @@ -1338,7 +1338,7 @@ static void restore_window(CPUSPARCState *env) printf("win_underflow: sp_ptr=0x" TARGET_ABI_FMT_lx " load_cwp=%d\n", sp_ptr, cwp1); #endif - for(i = 0; i < 16; i++) { + for (i = 0; i < 16; i++) { /* FIXME - what to do if get_user() fails? */ get_user_ual(env->regbase[get_reg_index(env, cwp1, 8 + i)], sp_ptr); sp_ptr += sizeof(abi_ulong); @@ -1359,7 +1359,7 @@ static void flush_windows(CPUSPARCState *env) int offset, cwp1; offset = 1; - for(;;) { + for (;;) { /* if restore would invoke restore_window(), then we can stop */ cwp1 = cpu_cwp_inc(env, env->cwp + offset); #ifndef TARGET_SPARC64 @@ -1386,7 +1386,7 @@ static void flush_windows(CPUSPARCState *env) #endif } -void cpu_loop (CPUSPARCState *env) +void cpu_loop(CPUSPARCState *env) { CPUState *cs = CPU(sparc_env_get_cpu(env)); int trapnr; @@ -1411,7 +1411,7 @@ void cpu_loop (CPUSPARCState *env) case 0x110: case 0x16d: #endif - ret = do_syscall (env, env->gregs[1], + ret = do_syscall(env, env->gregs[1], env->regwptr[0], env->regwptr[1], env->regwptr[2], env->regwptr[3], env->regwptr[4], env->regwptr[5], @@ -1524,11 +1524,11 @@ void cpu_loop (CPUSPARCState *env) } break; default: - printf ("Unhandled trap: 0x%x\n", trapnr); + printf("Unhandled trap: 0x%x\n", trapnr); cpu_dump_state(cs, stderr, fprintf, 0); exit(EXIT_FAILURE); } - process_pending_signals (env); + process_pending_signals(env); } } @@ -1561,7 +1561,7 @@ uint32_t cpu_ppc_load_atbu(CPUPPCState *env) } uint32_t cpu_ppc601_load_rtcu(CPUPPCState *env) -__attribute__ (( alias ("cpu_ppc_load_tbu") )); +__attribute__((alias("cpu_ppc_load_tbu"))); uint32_t cpu_ppc601_load_rtcl(CPUPPCState *env) { @@ -1569,12 +1569,12 @@ uint32_t cpu_ppc601_load_rtcl(CPUPPCState *env) } /* XXX: to be fixed */ -int ppc_dcr_read (ppc_dcr_t *dcr_env, int dcrn, uint32_t *valp) +int ppc_dcr_read(ppc_dcr_t *dcr_env, int dcrn, uint32_t *valp) { return -1; } -int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, uint32_t val) +int ppc_dcr_write(ppc_dcr_t *dcr_env, int dcrn, uint32_t val) { return -1; } @@ -1628,9 +1628,9 @@ static int do_store_exclusive(CPUPPCState *env) if (val2 == env->reserve_val2) { if (msr_le) { val2 = val; - val = env->gpr[reg+1]; + val = env->gpr[reg + 1]; } else { - val2 = env->gpr[reg+1]; + val2 = env->gpr[reg + 1]; } segv = put_user_u64(val, addr); if (!segv) { @@ -1665,11 +1665,11 @@ void cpu_loop(CPUPPCState *env) int trapnr; target_ulong ret; - for(;;) { + for (;;) { cpu_exec_start(cs); trapnr = cpu_exec(cs); cpu_exec_end(cs); - switch(trapnr) { + switch (trapnr) { case POWERPC_EXCP_NONE: /* Just go on */ break; @@ -2511,11 +2511,11 @@ void cpu_loop(CPUMIPSState *env) unsigned int syscall_num; # endif - for(;;) { + for (;;) { cpu_exec_start(cs); trapnr = cpu_exec(cs); cpu_exec_end(cs); - switch(trapnr) { + switch (trapnr) { case EXCP_SYSCALL: env->active_tc.PC += 4; # ifdef TARGET_ABI_MIPSO32 @@ -2893,11 +2893,11 @@ void cpu_loop(CPUSH4State *env) break; default: - printf ("Unhandled trap: 0x%x\n", trapnr); + printf("Unhandled trap: 0x%x\n", trapnr); cpu_dump_state(cs, stderr, fprintf, 0); exit(EXIT_FAILURE); } - process_pending_signals (env); + process_pending_signals(env); } } #endif @@ -2957,11 +2957,11 @@ void cpu_loop(CPUCRISState *env) } break; default: - printf ("Unhandled trap: 0x%x\n", trapnr); + printf("Unhandled trap: 0x%x\n", trapnr); cpu_dump_state(cs, stderr, fprintf, 0); exit(EXIT_FAILURE); } - process_pending_signals (env); + process_pending_signals(env); } } #endif @@ -3049,7 +3049,7 @@ void cpu_loop(CPUMBState *env) queue_signal(env, info.si_signo, &info); break; default: - printf ("Unhandled hw-exception: 0x%x\n", + printf("Unhandled hw-exception: 0x%x\n", env->sregs[SR_ESR] & ESR_EC_MASK); cpu_dump_state(cs, stderr, fprintf, 0); exit(EXIT_FAILURE); @@ -3070,11 +3070,11 @@ void cpu_loop(CPUMBState *env) } break; default: - printf ("Unhandled trap: 0x%x\n", trapnr); + printf("Unhandled trap: 0x%x\n", trapnr); cpu_dump_state(cs, stderr, fprintf, 0); exit(EXIT_FAILURE); } - process_pending_signals (env); + process_pending_signals(env); } } #endif @@ -3089,11 +3089,11 @@ void cpu_loop(CPUM68KState *env) target_siginfo_t info; TaskState *ts = cs->opaque; - for(;;) { + for (;;) { cpu_exec_start(cs); trapnr = cpu_exec(cs); cpu_exec_end(cs); - switch(trapnr) { + switch (trapnr) { case EXCP_ILLEGAL: { if (ts->sim_syscalls) { @@ -3405,11 +3405,11 @@ void cpu_loop(CPUAlphaState *env) /* Just indicate that signals should be handled asap. */ break; default: - printf ("Unhandled trap: 0x%x\n", trapnr); + printf("Unhandled trap: 0x%x\n", trapnr); cpu_dump_state(cs, stderr, fprintf, 0); exit(EXIT_FAILURE); } - process_pending_signals (env); + process_pending_signals(env); } } #endif /* TARGET_ALPHA */ @@ -3536,7 +3536,7 @@ void cpu_loop(CPUS390XState *env) cpu_dump_state(cs, stderr, fprintf, 0); exit(EXIT_FAILURE); } - process_pending_signals (env); + process_pending_signals(env); } } @@ -4111,7 +4111,7 @@ static void usage(int exitcode) } } - printf("%-*s %-*s Description\n", maxarglen+1, "Argument", + printf("%-*s %-*s Description\n", maxarglen + 1, "Argument", maxenvlen, "Env-variable"); for (arginfo = arg_table; arginfo->handle_opt != NULL; arginfo++) { @@ -4279,7 +4279,7 @@ int main(int argc, char **argv, char **envp) /* Zero out image_info */ memset(info, 0, sizeof(struct image_info)); - memset(&bprm, 0, sizeof (bprm)); + memset(&bprm, 0, sizeof(bprm)); /* Scan interp_prefix dir for replacement files. */ init_paths(interp_prefix); @@ -4393,7 +4393,7 @@ int main(int argc, char **argv, char **envp) * Prepare copy of argv vector for target. */ target_argc = argc - optind; - target_argv = calloc(target_argc + 1, sizeof (char *)); + target_argv = calloc(target_argc + 1, sizeof(char *)); if (target_argv == NULL) { (void) fprintf(stderr, "Unable to allocate memory for target_argv\n"); exit(EXIT_FAILURE); @@ -4519,8 +4519,8 @@ int main(int argc, char **argv, char **envp) env->idt.limit = 255; #endif env->idt.base = target_mmap(0, sizeof(uint64_t) * (env->idt.limit + 1), - PROT_READ|PROT_WRITE, - MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); + PROT_READ | PROT_WRITE, + MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); idt_table = g2h(env->idt.base); set_idt(0, 0); set_idt(1, 0); @@ -4548,8 +4548,8 @@ int main(int argc, char **argv, char **envp) { uint64_t *gdt_table; env->gdt.base = target_mmap(0, sizeof(uint64_t) * TARGET_GDT_ENTRIES, - PROT_READ|PROT_WRITE, - MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); + PROT_READ | PROT_WRITE, + MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); env->gdt.limit = sizeof(uint64_t) * TARGET_GDT_ENTRIES - 1; gdt_table = g2h(env->gdt.base); #ifdef TARGET_ABI32 @@ -4603,7 +4603,7 @@ int main(int argc, char **argv, char **envp) int i; cpsr_write(env, regs->uregs[16], CPSR_USER | CPSR_EXEC, CPSRWriteByInstr); - for(i = 0; i < 16; i++) { + for (i = 0; i < 16; i++) { env->regs[i] = regs->uregs[i]; } #ifdef TARGET_WORDS_BIGENDIAN @@ -4650,7 +4650,7 @@ int main(int argc, char **argv, char **envp) #endif #endif env->nip = regs->nip; - for(i = 0; i < 32; i++) { + for (i = 0; i < 32; i++) { env->gpr[i] = regs->gpr[i]; } } @@ -4716,7 +4716,7 @@ int main(int argc, char **argv, char **envp) { int i; - for(i = 0; i < 32; i++) { + for (i = 0; i < 32; i++) { env->active_tc.gpr[i] = regs->regs[i]; } env->active_tc.PC = regs->cp0_epc & ~(target_ulong)1; @@ -4753,7 +4753,7 @@ int main(int argc, char **argv, char **envp) { int i; - for(i = 0; i < 16; i++) { + for (i = 0; i < 16; i++) { env->gregs[i] = regs->regs[i]; } env->pc = regs->pc; @@ -4762,7 +4762,7 @@ int main(int argc, char **argv, char **envp) { int i; - for(i = 0; i < 28; i++) { + for (i = 0; i < 28; i++) { env->ir[i] = ((abi_ulong *)regs)[i]; } env->ir[IR_SP] = regs->usp;