Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B7501C77B61 for ; Thu, 13 Apr 2023 06:20:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4973C85C5E; Thu, 13 Apr 2023 08:20:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinylab.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 6F9948598A; Thu, 13 Apr 2023 08:20:26 +0200 (CEST) Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 11645859E0 for ; Thu, 13 Apr 2023 08:20:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinylab.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng@tinylab.org X-QQ-mid: bizesmtp73t1681366816t8s97g56 Received: from ubuntu.. ( [111.196.129.125]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 13 Apr 2023 14:20:15 +0800 (CST) X-QQ-SSF: 01200000000000D0F000000A0000000 X-QQ-FEAT: B8vEhG33zUTf88NnbY7MUzryoYnRme+ZdCGS7qMe++9cP3QNdNQwEjHKbDH0E 4vqCaYyZlxjfioTir06YwncDZFg7gPweD3K0Sh3yy+Yhq5rHYypwcfBuj0Uk0wdynS/uUgW +i87U5aqGIxn96KPqBHwdFJED4TJJx9CODYYTg768PNeBCZ4HiHKeK3+Roi+QYUe7+DWTaP G/VhmHGdELsJxsn4kiPNi6kXYX3OxIxMTIzbJ/mdZzFu2B3GPg+vnyShf6BUhWwop4xQx4A GlvT1sGiyUXMcuFv15E2bqPaq0smvdrjUT9yKfz5glaIFCVQ4ZDTzKY7yP7t3qyawHFaaxL j69QMvoVDZkXEcrD5BTsVxtALc/nw9bEPdfNEu9 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 11810896114413394289 From: Bin Meng To: u-boot@lists.denx.de Cc: Rick Chen Subject: [PATCH v2 3/9] tools: prelink-riscv: Cosmetic style fixes Date: Thu, 13 Apr 2023 14:20:02 +0800 Message-Id: <20230413062008.981238-3-bmeng@tinylab.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230413062008.981238-1-bmeng@tinylab.org> References: <20230413062008.981238-1-bmeng@tinylab.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz7a-0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Some coding convention fixes. Signed-off-by: Bin Meng Reviewed-by: Rick Chen --- (no changes since v1) tools/prelink-riscv.inc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/prelink-riscv.inc b/tools/prelink-riscv.inc index f2b5467f5b..57c0f655d4 100644 --- a/tools/prelink-riscv.inc +++ b/tools/prelink-riscv.inc @@ -30,7 +30,7 @@ #define cpu_to_target32 CONCAT3(cpu_to_, PRELINK_BYTEORDER, 32) #define cpu_to_target64 CONCAT3(cpu_to_, PRELINK_BYTEORDER, 64) -static void* get_offset_bonn (void* data, Elf_Phdr* phdrs, size_t phnum, Elf_Addr addr) +static void *get_offset_bonn(void *data, Elf_Phdr *phdrs, size_t phnum, Elf_Addr addr) { Elf_Phdr *p; @@ -67,13 +67,13 @@ static void prelink_bonn(void *data) Elf_Rela *rela_dyn = NULL; size_t rela_count = 0; Elf_Sym *dynsym = NULL; - for (dyn = dyns;; ++dyn) { + for (dyn = dyns; ; ++dyn) { if (targetnn_to_cpu(dyn->d_tag) == DT_NULL) break; else if (targetnn_to_cpu(dyn->d_tag) == DT_RELA) rela_dyn = get_offset_bonn(data, phdrs, target16_to_cpu(ehdr->e_phnum), + targetnn_to_cpu(dyn->d_un.d_ptr)); else if (targetnn_to_cpu(dyn->d_tag) == DT_RELASZ) - rela_count = targetnn_to_cpu(dyn->d_un.d_val) / sizeof(Elf_Rela); + rela_count = targetnn_to_cpu(dyn->d_un.d_val) / sizeof(Elf_Rela); else if (targetnn_to_cpu(dyn->d_tag) == DT_SYMTAB) dynsym = get_offset_bonn(data, phdrs, target16_to_cpu(ehdr->e_phnum), + targetnn_to_cpu(dyn->d_un.d_ptr)); @@ -92,11 +92,11 @@ static void prelink_bonn(void *data) continue; if (ELF_R_TYPE(targetnn_to_cpu(r->r_info)) == R_RISCV_RELATIVE) - *((uintnn_t*) buf) = r->r_addend; + *((uintnn_t *)buf) = r->r_addend; else if (ELF_R_TYPE(targetnn_to_cpu(r->r_info)) == R_RISCV_32) - *((uint32_t*) buf) = cpu_to_target32(targetnn_to_cpu(dynsym[ELF_R_SYM(targetnn_to_cpu(r->r_info))].st_value) + targetnn_to_cpu(r->r_addend)); + *((uint32_t *)buf) = cpu_to_target32(targetnn_to_cpu(dynsym[ELF_R_SYM(targetnn_to_cpu(r->r_info))].st_value) + targetnn_to_cpu(r->r_addend)); else if (ELF_R_TYPE(targetnn_to_cpu(r->r_info)) == R_RISCV_64) - *((uint64_t*) buf) = cpu_to_target64(targetnn_to_cpu(dynsym[ELF_R_SYM(targetnn_to_cpu(r->r_info))].st_value) + targetnn_to_cpu(r->r_addend)); + *((uint64_t *)buf) = cpu_to_target64(targetnn_to_cpu(dynsym[ELF_R_SYM(targetnn_to_cpu(r->r_info))].st_value) + targetnn_to_cpu(r->r_addend)); } } -- 2.34.1