From patchwork Wed Nov 4 10:20:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shiliyang X-Patchwork-Id: 11880153 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1592314B4 for ; Wed, 4 Nov 2020 10:22:07 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 38D6822243 for ; Wed, 4 Nov 2020 10:22:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 38D6822243 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaFvY-0002iL-Ri for patchwork-qemu-devel@patchwork.kernel.org; Wed, 04 Nov 2020 05:22:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaFuh-0001jO-5w; Wed, 04 Nov 2020 05:21:11 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:2436) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaFub-00020p-MT; Wed, 04 Nov 2020 05:21:10 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CR2jT4C21zLlZr; Wed, 4 Nov 2020 18:20:45 +0800 (CST) Received: from [10.108.235.13] (10.108.235.13) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Wed, 4 Nov 2020 18:20:44 +0800 Subject: [PATCH 1/4] bsd-user: space required after semicolon References: To: , , , , From: shiliyang X-Forwarded-Message-Id: Message-ID: Date: Wed, 4 Nov 2020 18:20:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [10.108.235.13] X-CFilter-Loop: Reflected Received-SPF: pass client-ip=45.249.212.191; envelope-from=shiliyang@huawei.com; helo=szxga05-in.huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/04 05:20:51 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.chen@huawei.com, hunongda@huawei.com, qemu-trivial@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This patch fixes error style problems found by checkpatch.pl: ERROR: space required after that ';' Signed-off-by: Liyang Shi --- bsd-user/elfload.c | 2 +- bsd-user/syscall.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index 9f4210af9a..25e625d86b 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -1227,7 +1227,7 @@ int load_elf_binary(struct linux_binprm *bprm, struct target_pt_regs *regs, end_data = 0; interp_ex.a_info = 0; - for(i=0;i < elf_ex.e_phnum; i++) { + for(i=0; i < elf_ex.e_phnum; i++) { if (elf_ppnt->p_type == PT_INTERP) { if ( elf_interpreter != NULL ) { diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 9b471b665c..b178d87de1 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -271,7 +271,7 @@ static abi_long lock_iovec(int type, struct iovec *vec, abi_ulong target_addr, target_vec = lock_user(VERIFY_READ, target_addr, count * sizeof(struct target_iovec), 1); if (!target_vec) return -TARGET_EFAULT; - for(i = 0;i < count; i++) { + for(i = 0; i < count; i++) { base = tswapl(target_vec[i].iov_base); vec[i].iov_len = tswapl(target_vec[i].iov_len); if (vec[i].iov_len != 0) { @@ -297,7 +297,7 @@ static abi_long unlock_iovec(struct iovec *vec, abi_ulong target_addr, target_vec = lock_user(VERIFY_READ, target_addr, count * sizeof(struct target_iovec), 1); if (!target_vec) return -TARGET_EFAULT; - for(i = 0;i < count; i++) { + for(i = 0; i < count; i++) { if (target_vec[i].iov_base) { base = tswapl(target_vec[i].iov_base); unlock_user(vec[i].iov_base, base, copy ? vec[i].iov_len : 0); From patchwork Wed Nov 4 10:21:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shiliyang X-Patchwork-Id: 11880161 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 755791130 for ; Wed, 4 Nov 2020 10:24:25 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D01A522243 for ; Wed, 4 Nov 2020 10:24:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D01A522243 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:55514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaFxm-0005Lm-K1 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 04 Nov 2020 05:24:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaFuw-0001vn-1A; Wed, 04 Nov 2020 05:21:27 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:2327) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaFut-0002AW-EO; Wed, 04 Nov 2020 05:21:25 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CR2jz2H9XzkcB7; Wed, 4 Nov 2020 18:21:11 +0800 (CST) Received: from [10.108.235.13] (10.108.235.13) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Wed, 4 Nov 2020 18:21:05 +0800 Subject: [PATCH 2/4] bsd-user: do not use C99 // comments References: To: , , , , From: shiliyang X-Forwarded-Message-Id: Message-ID: Date: Wed, 4 Nov 2020 18:21:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [10.108.235.13] X-CFilter-Loop: Reflected Received-SPF: pass client-ip=45.249.212.190; envelope-from=shiliyang@huawei.com; helo=szxga04-in.huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/04 05:21:16 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.chen@huawei.com, qemu-trivial@nongnu.org, qemu-devel@nongnu.org, hunongda@huawei.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This patch fixes error style problems found by checkpatch.pl: ERROR: do not use C99 // comments Signed-off-by: Liyang Shi --- bsd-user/elfload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index 25e625d86b..30d2d6b7a1 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -1010,7 +1010,7 @@ static const char *lookup_symbolxx(struct syminfo *s, target_ulong orig_addr) struct elf_sym *syms = s->disas_symtab.elf64; #endif - // binary search + /* binary search */ struct elf_sym *sym; sym = bsearch(&orig_addr, syms, s->disas_num_syms, sizeof(*syms), symfind); @@ -1092,7 +1092,7 @@ static void load_symbols(struct elfhdr *hdr, int fd) #ifdef BSWAP_NEEDED bswap_sym(syms + i); #endif - // Throw away entries which we do not need. + /* Throw away entries which we do not need. */ if (syms[i].st_shndx == SHN_UNDEF || syms[i].st_shndx >= SHN_LORESERVE || ELF_ST_TYPE(syms[i].st_info) != STT_FUNC) { From patchwork Wed Nov 4 10:21:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shiliyang X-Patchwork-Id: 11880175 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3F6B514B4 for ; Wed, 4 Nov 2020 10:26:01 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA6FA223FD for ; Wed, 4 Nov 2020 10:26:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA6FA223FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:33554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaFzL-0007xx-Kh for patchwork-qemu-devel@patchwork.kernel.org; Wed, 04 Nov 2020 05:25:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaFv5-0001xt-G5; Wed, 04 Nov 2020 05:21:35 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:2328) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaFv2-0002BD-Pj; Wed, 04 Nov 2020 05:21:35 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CR2kF3sMdzkZV4; Wed, 4 Nov 2020 18:21:25 +0800 (CST) Received: from [10.108.235.13] (10.108.235.13) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Wed, 4 Nov 2020 18:21:21 +0800 Subject: [PATCH 3/4] bsd-user: "foo * bar" should be "foo *bar" References: <81473730-4d0a-47e0-71f0-3aebdc7401e4@huawei.com> To: , , , , From: shiliyang X-Forwarded-Message-Id: <81473730-4d0a-47e0-71f0-3aebdc7401e4@huawei.com> Message-ID: Date: Wed, 4 Nov 2020 18:21:21 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <81473730-4d0a-47e0-71f0-3aebdc7401e4@huawei.com> Content-Language: en-US X-Originating-IP: [10.108.235.13] X-CFilter-Loop: Reflected Received-SPF: pass client-ip=45.249.212.190; envelope-from=shiliyang@huawei.com; helo=szxga04-in.huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/04 05:21:16 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.chen@huawei.com, qemu-trivial@nongnu.org, qemu-devel@nongnu.org, hunongda@huawei.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This patch fixes error style problems found by checkpatch.pl: ERROR: "foo ** bar" should be "foo **bar". ERROR: "foo * bar" should be "foo *bar" Signed-off-by: Liyang Shi --- bsd-user/bsdload.c | 6 +++--- bsd-user/elfload.c | 22 +++++++++++----------- bsd-user/qemu.h | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c index f38c4faacf..b2f352c041 100644 --- a/bsd-user/bsdload.c +++ b/bsd-user/bsdload.c @@ -20,7 +20,7 @@ abi_long memcpy_to_target(abi_ulong dest, const void *src, return 0; } -static int count(char ** vec) +static int count(char **vec) { int i; @@ -125,8 +125,8 @@ abi_ulong loader_build_argptr(int envc, int argc, abi_ulong sp, return sp; } -int loader_exec(const char * filename, char ** argv, char ** envp, - struct target_pt_regs * regs, struct image_info *infop) +int loader_exec(const char *filename, char **argv, char **envp, + struct target_pt_regs *regs, struct image_info *infop) { struct linux_binprm bprm; int retval; diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index 32378af7b2..d5746f25e7 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -547,12 +547,12 @@ struct exec #define DLINFO_ITEMS 12 -static inline void memcpy_fromfs(void * to, const void * from, unsigned long n) +static inline void memcpy_fromfs(void *to, const void *from, unsigned long n) { memcpy(to, from, n); } -static int load_aout_interp(void * exptr, int interp_fd); +static int load_aout_interp(void *exptr, int interp_fd); #ifdef BSWAP_NEEDED static void bswap_ehdr(struct elfhdr *ehdr) @@ -613,7 +613,7 @@ static void bswap_sym(struct elf_sym *sym) * to be put directly into the top of new user memory. * */ -static abi_ulong copy_elf_strings(int argc,char ** argv, void **page, +static abi_ulong copy_elf_strings(int argc,char **argv, void **page, abi_ulong p) { char *tmp, *tmp1, *pag = NULL; @@ -756,7 +756,7 @@ static void padzero(abi_ulong elf_bss, abi_ulong last_bss) static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc, - struct elfhdr * exec, + struct elfhdr *exec, abi_ulong load_addr, abi_ulong load_bias, abi_ulong interp_load_addr, int ibcs, @@ -834,7 +834,7 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc, } -static abi_ulong load_elf_interp(struct elfhdr * interp_elf_ex, +static abi_ulong load_elf_interp(struct elfhdr *interp_elf_ex, int interpreter_fd, abi_ulong *interp_load_addr) { @@ -1143,8 +1143,8 @@ static void load_symbols(struct elfhdr *hdr, int fd) syminfos = s; } -int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, - struct image_info * info) +int load_elf_binary(struct linux_binprm *bprm, struct target_pt_regs *regs, + struct image_info *info) { struct elfhdr elf_ex; struct elfhdr interp_elf_ex; @@ -1155,11 +1155,11 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, unsigned int interpreter_type = INTERPRETER_NONE; unsigned char ibcs2_interpreter; int i; - struct elf_phdr * elf_ppnt; + struct elf_phdr *elf_ppnt; struct elf_phdr *elf_phdata; abi_ulong elf_bss, k, elf_brk; int retval; - char * elf_interpreter; + char *elf_interpreter; abi_ulong elf_entry, interp_load_addr = 0; abi_ulong start_code, end_code, start_data, end_data; abi_ulong reloc_func_desc = 0; @@ -1334,7 +1334,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, and then start this sucker up */ { - char * passed_p; + char *passed_p; if (interpreter_type == INTERPRETER_AOUT) { snprintf(passed_fileno, sizeof(passed_fileno), "%d", bprm->fd); @@ -1553,7 +1553,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, return 0; } -static int load_aout_interp(void * exptr, int interp_fd) +static int load_aout_interp(void *exptr, int interp_fd) { printf("a.out interpreter not yet supported\n"); return(0); diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index f8bb1e5459..cbf42129e4 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -123,19 +123,19 @@ struct linux_binprm { int argc, envc; char **argv; char **envp; - char * filename; /* Name of binary */ + char *filename; /* Name of binary */ }; void do_init_thread(struct target_pt_regs *regs, struct image_info *infop); abi_ulong loader_build_argptr(int envc, int argc, abi_ulong sp, abi_ulong stringp, int push_ptr); -int loader_exec(const char * filename, char ** argv, char ** envp, - struct target_pt_regs * regs, struct image_info *infop); +int loader_exec(const char *filename, char **argv, char **envp, + struct target_pt_regs *regs, struct image_info *infop); -int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, - struct image_info * info); -int load_flt_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, - struct image_info * info); +int load_elf_binary(struct linux_binprm *bprm, struct target_pt_regs *regs, + struct image_info *info); +int load_flt_binary(struct linux_binprm *bprm, struct target_pt_regs *regs, + struct image_info *info); abi_long memcpy_to_target(abi_ulong dest, const void *src, unsigned long len); From patchwork Wed Nov 4 10:21:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shiliyang X-Patchwork-Id: 11880157 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E90311130 for ; Wed, 4 Nov 2020 10:23:15 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F560223C7 for ; Wed, 4 Nov 2020 10:23:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F560223C7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaFwg-0003hv-GW for patchwork-qemu-devel@patchwork.kernel.org; Wed, 04 Nov 2020 05:23:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaFvJ-0002Ex-4U; Wed, 04 Nov 2020 05:21:49 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:2074) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaFvF-0002Bk-K1; Wed, 04 Nov 2020 05:21:48 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4CR2kX5VDwzhZlP; Wed, 4 Nov 2020 18:21:40 +0800 (CST) Received: from [10.108.235.13] (10.108.235.13) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Wed, 4 Nov 2020 18:21:34 +0800 Subject: [PATCH 4/4] bsd-user: suspect code indent for conditional statements References: <7ff969d1-3ed9-8723-3270-5737c9c4d1f7@huawei.com> To: , , , , From: shiliyang X-Forwarded-Message-Id: <7ff969d1-3ed9-8723-3270-5737c9c4d1f7@huawei.com> Message-ID: Date: Wed, 4 Nov 2020 18:21:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <7ff969d1-3ed9-8723-3270-5737c9c4d1f7@huawei.com> Content-Language: en-US X-Originating-IP: [10.108.235.13] X-CFilter-Loop: Reflected Received-SPF: pass client-ip=45.249.212.32; envelope-from=shiliyang@huawei.com; helo=szxga06-in.huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/04 05:21:41 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.chen@huawei.com, qemu-trivial@nongnu.org, qemu-devel@nongnu.org, hunongda@huawei.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This patch fixes error style problems found by checkpatch.pl: ERROR: suspect code indent for conditional statements Signed-off-by: Liyang Shi --- bsd-user/elfload.c | 10 +++++----- bsd-user/main.c | 4 ++-- bsd-user/syscall.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index d5746f25e7..9f4210af9a 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -184,7 +184,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i memset(regs, 0, sizeof(*regs)); regs->ARM_cpsr = 0x10; if (infop->entry & 1) - regs->ARM_cpsr |= CPSR_T; + regs->ARM_cpsr |= CPSR_T; regs->ARM_pc = infop->entry & 0xfffffffe; regs->ARM_sp = infop->start_stack; /* FIXME - what to for failure of get_user()? */ @@ -784,7 +784,7 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc, sp = sp &~ (abi_ulong)15; size = (DLINFO_ITEMS + 1) * 2; if (k_platform) - size += 2; + size += 2; #ifdef DLINFO_ARCH_ITEMS size += DLINFO_ARCH_ITEMS * 2; #endif @@ -871,7 +871,7 @@ static abi_ulong load_elf_interp(struct elfhdr *interp_elf_ex, malloc(sizeof(struct elf_phdr) * interp_elf_ex->e_phnum); if (!elf_phdata) - return ~((abi_ulong)0UL); + return ~((abi_ulong)0UL); /* * If the size of this structure has changed, then punt, since @@ -1267,7 +1267,7 @@ int load_elf_binary(struct linux_binprm *bprm, struct target_pt_regs *regs, if (strcmp(elf_interpreter,"/usr/lib/libc.so.1") == 0 || strcmp(elf_interpreter,"/usr/lib/ld.so.1") == 0) { - ibcs2_interpreter = 1; + ibcs2_interpreter = 1; } #if 0 @@ -1314,7 +1314,7 @@ int load_elf_binary(struct linux_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/main.c b/bsd-user/main.c index ac40d79bfa..d8a2011501 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -831,8 +831,8 @@ int main(int argc, char **argv) exit(1); } } else if (!strcmp(r, "B")) { - guest_base = strtol(argv[optind++], NULL, 0); - have_guest_base = true; + guest_base = strtol(argv[optind++], NULL, 0); + have_guest_base = true; } else if (!strcmp(r, "drop-ld-preload")) { (void) envlist_unsetenv(envlist, "LD_PRELOAD"); } else if (!strcmp(r, "bsd")) { diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index d38ec7a162..9b471b665c 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -241,7 +241,7 @@ static abi_long do_freebsd_sysctl(abi_ulong namep, int32_t namelen, abi_ulong ol return -TARGET_EFAULT; holdlen = oldlen; for (p = hnamep, q = snamep, i = 0; i < namelen; p++, i++) - *q++ = tswap32(*p); + *q++ = tswap32(*p); oidfmt(snamep, namelen, NULL, &kind); /* XXX swap hnewp */ ret = get_errno(sysctl(snamep, namelen, holdp, &holdlen, hnewp, newlen));