From nobody Tue Feb 10 04:16:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1576500518; cv=none; d=zohomail.com; s=zohoarc; b=OWWvDL/GZEdvjE+Tk+2StPRPyR+g33HCOL7ZAsNRi9zGh6NL0YvVGDYLEvS50oGG+Rdwtj0ALLoNAfcg4zWSINmRVevATHVufd0TXQktp3L6Bc0RHVbQbZlUiDmyJiiUIvfWayEWfATYyEJWbvG2Cb7wJ2BEAH2fQxzCabaHmdg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576500518; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=Abto7B0jJykFwobcn/E4ddtypMMenkOXyrjgwcPZOGY=; b=HVFSB72z9qWZUPYX1KJ9ZFVfp5q3TxAHkm3bLxN49wzc63lP8BhPWEBlWJlbGH71B77+wkockw5OxoNeWmeW5GrQXny54i3WVRDstMIFGo07sNIsijCxoGfz2WiExvPv4ugPM3kwp5bi1NHNbQw0PNY58CvN2P4dTQaghTf1EoM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576500518933190.35422183167123; Mon, 16 Dec 2019 04:48:38 -0800 (PST) Received: from localhost ([::1]:52902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igpng-0003Rh-Ua for importer@patchew.org; Mon, 16 Dec 2019 07:48:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58765) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igpjO-0006kE-7g for qemu-devel@nongnu.org; Mon, 16 Dec 2019 07:44:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igpjL-0006uo-PA for qemu-devel@nongnu.org; Mon, 16 Dec 2019 07:44:09 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:42931 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igpjL-0005ly-DA for qemu-devel@nongnu.org; Mon, 16 Dec 2019 07:44:07 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id B1F051A2062; Mon, 16 Dec 2019 13:43:01 +0100 (CET) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 8747B1A206A; Mon, 16 Dec 2019 13:43:01 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PULL 02/11] mips: malta: Renovate coding style Date: Mon, 16 Dec 2019 13:42:43 +0100 Message-Id: <1576500172-11264-3-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1576500172-11264-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1576500172-11264-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 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: peter.maydell@linaro.org, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Filip Bozuta The script checkpatch.pl located in scripts folder was used to detect all errors and warrnings in files: hw/mips/mips_malta.c hw/mips/gt64xxx_pci.c tests/acceptance/linux_ssh_mips_malta.py All these mips malta machine files were edited and all the errors and warrings generated by the checkpatch.pl script were corrected and then the script was ran again to make sure there are no more errors and warnings. Signed-off-by: Filip Bozuta Signed-off-by: Aleksandar Markovic Reviewed-by: Aleksandar Markovic Message-Id: <1575640687-20744-3-git-send-email-Filip.Bozuta@rt-rk.com> --- hw/mips/mips_malta.c | 172 ++++++++++++++++-----------= ---- tests/acceptance/linux_ssh_mips_malta.py | 6 +- 2 files changed, 91 insertions(+), 87 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 92e9ca5..783cd99 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -137,7 +137,8 @@ static void malta_fpga_update_display(void *opaque) */ =20 #if defined(DEBUG) -# define logout(fmt, ...) fprintf(stderr, "MALTA\t%-24s" fmt, __func__, #= # __VA_ARGS__) +# define logout(fmt, ...) \ + fprintf(stderr, "MALTA\t%-24s" fmt, __func__, ## __VA_ARGS__) #else # define logout(fmt, ...) ((void)0) #endif @@ -359,7 +360,6 @@ static uint64_t malta_fpga_read(void *opaque, hwaddr ad= dr, =20 /* SWITCH Register */ case 0x00200: - /* ori a3, a3, low(ram_low_size) */ val =3D 0x00000000; break; =20 @@ -569,7 +569,7 @@ static MaltaFPGAState *malta_fpga_init(MemoryRegion *ad= dress_space, MaltaFPGAState *s; Chardev *chr; =20 - s =3D (MaltaFPGAState *)g_malloc0(sizeof(MaltaFPGAState)); + s =3D g_new0(MaltaFPGAState, 1); =20 memory_region_init_io(&s->iomem, NULL, &malta_fpga_ops, s, "malta-fpga", 0x100000); @@ -844,24 +844,24 @@ static void write_bootloader(uint8_t *base, int64_t r= un_addr, /* Small bootloader */ p =3D (uint32_t *)base; =20 - stl_p(p++, 0x08000000 | /* j 0x1f= c00580 */ + stl_p(p++, 0x08000000 | /* j 0x1fc00580 */ ((run_addr + 0x580) & 0x0fffffff) >> 2); - stl_p(p++, 0x00000000); /* nop */ + stl_p(p++, 0x00000000); /* nop */ =20 /* YAMON service vector */ - stl_p(base + 0x500, run_addr + 0x0580); /* start: */ - stl_p(base + 0x504, run_addr + 0x083c); /* print_count: */ - stl_p(base + 0x520, run_addr + 0x0580); /* start: */ - stl_p(base + 0x52c, run_addr + 0x0800); /* flush_cache: */ - stl_p(base + 0x534, run_addr + 0x0808); /* print: */ - stl_p(base + 0x538, run_addr + 0x0800); /* reg_cpu_isr: */ - stl_p(base + 0x53c, run_addr + 0x0800); /* unred_cpu_isr: */ - stl_p(base + 0x540, run_addr + 0x0800); /* reg_ic_isr: */ - stl_p(base + 0x544, run_addr + 0x0800); /* unred_ic_isr: */ - stl_p(base + 0x548, run_addr + 0x0800); /* reg_esr: */ - stl_p(base + 0x54c, run_addr + 0x0800); /* unreg_esr: */ - stl_p(base + 0x550, run_addr + 0x0800); /* getchar: */ - stl_p(base + 0x554, run_addr + 0x0800); /* syscon_read: */ + stl_p(base + 0x500, run_addr + 0x0580); /* start: */ + stl_p(base + 0x504, run_addr + 0x083c); /* print_count: */ + stl_p(base + 0x520, run_addr + 0x0580); /* start: */ + stl_p(base + 0x52c, run_addr + 0x0800); /* flush_cache: */ + stl_p(base + 0x534, run_addr + 0x0808); /* print: */ + stl_p(base + 0x538, run_addr + 0x0800); /* reg_cpu_isr: */ + stl_p(base + 0x53c, run_addr + 0x0800); /* unred_cpu_isr: */ + stl_p(base + 0x540, run_addr + 0x0800); /* reg_ic_isr: */ + stl_p(base + 0x544, run_addr + 0x0800); /* unred_ic_isr: */ + stl_p(base + 0x548, run_addr + 0x0800); /* reg_esr: */ + stl_p(base + 0x54c, run_addr + 0x0800); /* unreg_esr: */ + stl_p(base + 0x550, run_addr + 0x0800); /* getchar: */ + stl_p(base + 0x554, run_addr + 0x0800); /* syscon_read: */ =20 =20 /* Second part of the bootloader */ @@ -869,9 +869,9 @@ static void write_bootloader(uint8_t *base, int64_t run= _addr, =20 if (semihosting_get_argc()) { /* Preserve a0 content as arguments have been passed */ - stl_p(p++, 0x00000000); /* nop */ + stl_p(p++, 0x00000000); /* nop */ } else { - stl_p(p++, 0x24040002); /* addiu a0, zero,= 2 */ + stl_p(p++, 0x24040002); /* addiu a0, zero, 2 */ } =20 /* lui sp, high(ENVP_ADDR) */ @@ -892,104 +892,106 @@ static void write_bootloader(uint8_t *base, int64_t= run_addr, stl_p(p++, 0x34e70000 | (loaderparams.ram_low_size & 0xffff)); =20 /* Load BAR registers as done by YAMON */ - stl_p(p++, 0x3c09b400); /* lui t1= , 0xb400 */ + stl_p(p++, 0x3c09b400); /* lui t1, 0xb400 */ =20 #ifdef TARGET_WORDS_BIGENDIAN - stl_p(p++, 0x3c08df00); /* lui t0= , 0xdf00 */ + stl_p(p++, 0x3c08df00); /* lui t0, 0xdf00 */ #else - stl_p(p++, 0x340800df); /* ori t0= , r0, 0x00df */ + stl_p(p++, 0x340800df); /* ori t0, r0, 0x00df */ #endif - stl_p(p++, 0xad280068); /* sw t0,= 0x0068(t1) */ + stl_p(p++, 0xad280068); /* sw t0, 0x0068(t1) */ =20 - stl_p(p++, 0x3c09bbe0); /* lui t1= , 0xbbe0 */ + stl_p(p++, 0x3c09bbe0); /* lui t1, 0xbbe0 */ =20 #ifdef TARGET_WORDS_BIGENDIAN - stl_p(p++, 0x3c08c000); /* lui t0= , 0xc000 */ + stl_p(p++, 0x3c08c000); /* lui t0, 0xc000 */ #else - stl_p(p++, 0x340800c0); /* ori t0= , r0, 0x00c0 */ + stl_p(p++, 0x340800c0); /* ori t0, r0, 0x00c0 */ #endif - stl_p(p++, 0xad280048); /* sw t0,= 0x0048(t1) */ + stl_p(p++, 0xad280048); /* sw t0, 0x0048(t1) */ #ifdef TARGET_WORDS_BIGENDIAN - stl_p(p++, 0x3c084000); /* lui t0= , 0x4000 */ + stl_p(p++, 0x3c084000); /* lui t0, 0x4000 */ #else - stl_p(p++, 0x34080040); /* ori t0= , r0, 0x0040 */ + stl_p(p++, 0x34080040); /* ori t0, r0, 0x0040 */ #endif - stl_p(p++, 0xad280050); /* sw t0,= 0x0050(t1) */ + stl_p(p++, 0xad280050); /* sw t0, 0x0050(t1) */ =20 #ifdef TARGET_WORDS_BIGENDIAN - stl_p(p++, 0x3c088000); /* lui t0= , 0x8000 */ + stl_p(p++, 0x3c088000); /* lui t0, 0x8000 */ #else - stl_p(p++, 0x34080080); /* ori t0= , r0, 0x0080 */ + stl_p(p++, 0x34080080); /* ori t0, r0, 0x0080 */ #endif - stl_p(p++, 0xad280058); /* sw t0,= 0x0058(t1) */ + stl_p(p++, 0xad280058); /* sw t0, 0x0058(t1) */ #ifdef TARGET_WORDS_BIGENDIAN - stl_p(p++, 0x3c083f00); /* lui t0= , 0x3f00 */ + stl_p(p++, 0x3c083f00); /* lui t0, 0x3f00 */ #else - stl_p(p++, 0x3408003f); /* ori t0= , r0, 0x003f */ + stl_p(p++, 0x3408003f); /* ori t0, r0, 0x003f */ #endif - stl_p(p++, 0xad280060); /* sw t0,= 0x0060(t1) */ + stl_p(p++, 0xad280060); /* sw t0, 0x0060(t1) */ =20 #ifdef TARGET_WORDS_BIGENDIAN - stl_p(p++, 0x3c08c100); /* lui t0= , 0xc100 */ + stl_p(p++, 0x3c08c100); /* lui t0, 0xc100 */ #else - stl_p(p++, 0x340800c1); /* ori t0= , r0, 0x00c1 */ + stl_p(p++, 0x340800c1); /* ori t0, r0, 0x00c1 */ #endif - stl_p(p++, 0xad280080); /* sw t0,= 0x0080(t1) */ + stl_p(p++, 0xad280080); /* sw t0, 0x0080(t1) */ #ifdef TARGET_WORDS_BIGENDIAN - stl_p(p++, 0x3c085e00); /* lui t0= , 0x5e00 */ + stl_p(p++, 0x3c085e00); /* lui t0, 0x5e00 */ #else - stl_p(p++, 0x3408005e); /* ori t0= , r0, 0x005e */ + stl_p(p++, 0x3408005e); /* ori t0, r0, 0x005e */ #endif - stl_p(p++, 0xad280088); /* sw t0,= 0x0088(t1) */ + stl_p(p++, 0xad280088); /* sw t0, 0x0088(t1) */ =20 /* Jump to kernel code */ - stl_p(p++, 0x3c1f0000 | ((kernel_entry >> 16) & 0xffff)); /* lui ra= , high(kernel_entry) */ - stl_p(p++, 0x37ff0000 | (kernel_entry & 0xffff)); /* ori ra= , ra, low(kernel_entry) */ - stl_p(p++, 0x03e00009); /* jalr r= a */ - stl_p(p++, 0x00000000); /* nop */ + stl_p(p++, 0x3c1f0000 | + ((kernel_entry >> 16) & 0xffff)); /* lui ra, high(kernel_entry)= */ + stl_p(p++, 0x37ff0000 | + (kernel_entry & 0xffff)); /* ori ra, ra, low(kernel_ent= ry) */ + stl_p(p++, 0x03e00009); /* jalr ra */ + stl_p(p++, 0x00000000); /* nop */ =20 /* YAMON subroutines */ p =3D (uint32_t *) (base + 0x800); - stl_p(p++, 0x03e00009); /* jalr ra= */ - stl_p(p++, 0x24020000); /* li v0,0= */ + stl_p(p++, 0x03e00009); /* jalr ra */ + stl_p(p++, 0x24020000); /* li v0,0 */ /* 808 YAMON print */ - stl_p(p++, 0x03e06821); /* move t5= ,ra */ - stl_p(p++, 0x00805821); /* move t3= ,a0 */ - stl_p(p++, 0x00a05021); /* move t2= ,a1 */ - stl_p(p++, 0x91440000); /* lbu a0,= 0(t2) */ - stl_p(p++, 0x254a0001); /* addiu t= 2,t2,1 */ - stl_p(p++, 0x10800005); /* beqz a0= ,834 */ - stl_p(p++, 0x00000000); /* nop */ - stl_p(p++, 0x0ff0021c); /* jal 870= */ - stl_p(p++, 0x00000000); /* nop */ - stl_p(p++, 0x1000fff9); /* b 814 */ - stl_p(p++, 0x00000000); /* nop */ - stl_p(p++, 0x01a00009); /* jalr t5= */ - stl_p(p++, 0x01602021); /* move a0= ,t3 */ + stl_p(p++, 0x03e06821); /* move t5,ra */ + stl_p(p++, 0x00805821); /* move t3,a0 */ + stl_p(p++, 0x00a05021); /* move t2,a1 */ + stl_p(p++, 0x91440000); /* lbu a0,0(t2) */ + stl_p(p++, 0x254a0001); /* addiu t2,t2,1 */ + stl_p(p++, 0x10800005); /* beqz a0,834 */ + stl_p(p++, 0x00000000); /* nop */ + stl_p(p++, 0x0ff0021c); /* jal 870 */ + stl_p(p++, 0x00000000); /* nop */ + stl_p(p++, 0x1000fff9); /* b 814 */ + stl_p(p++, 0x00000000); /* nop */ + stl_p(p++, 0x01a00009); /* jalr t5 */ + stl_p(p++, 0x01602021); /* move a0,t3 */ /* 0x83c YAMON print_count */ - stl_p(p++, 0x03e06821); /* move t5= ,ra */ - stl_p(p++, 0x00805821); /* move t3= ,a0 */ - stl_p(p++, 0x00a05021); /* move t2= ,a1 */ - stl_p(p++, 0x00c06021); /* move t4= ,a2 */ - stl_p(p++, 0x91440000); /* lbu a0,= 0(t2) */ - stl_p(p++, 0x0ff0021c); /* jal 870= */ - stl_p(p++, 0x00000000); /* nop */ - stl_p(p++, 0x254a0001); /* addiu t= 2,t2,1 */ - stl_p(p++, 0x258cffff); /* addiu t= 4,t4,-1 */ - stl_p(p++, 0x1580fffa); /* bnez t4= ,84c */ - stl_p(p++, 0x00000000); /* nop */ - stl_p(p++, 0x01a00009); /* jalr t5= */ - stl_p(p++, 0x01602021); /* move a0= ,t3 */ + stl_p(p++, 0x03e06821); /* move t5,ra */ + stl_p(p++, 0x00805821); /* move t3,a0 */ + stl_p(p++, 0x00a05021); /* move t2,a1 */ + stl_p(p++, 0x00c06021); /* move t4,a2 */ + stl_p(p++, 0x91440000); /* lbu a0,0(t2) */ + stl_p(p++, 0x0ff0021c); /* jal 870 */ + stl_p(p++, 0x00000000); /* nop */ + stl_p(p++, 0x254a0001); /* addiu t2,t2,1 */ + stl_p(p++, 0x258cffff); /* addiu t4,t4,-1 */ + stl_p(p++, 0x1580fffa); /* bnez t4,84c */ + stl_p(p++, 0x00000000); /* nop */ + stl_p(p++, 0x01a00009); /* jalr t5 */ + stl_p(p++, 0x01602021); /* move a0,t3 */ /* 0x870 */ - stl_p(p++, 0x3c08b800); /* lui t0,= 0xb400 */ - stl_p(p++, 0x350803f8); /* ori t0,= t0,0x3f8 */ - stl_p(p++, 0x91090005); /* lbu t1,= 5(t0) */ - stl_p(p++, 0x00000000); /* nop */ - stl_p(p++, 0x31290040); /* andi t1= ,t1,0x40 */ - stl_p(p++, 0x1120fffc); /* beqz t1= ,878 */ - stl_p(p++, 0x00000000); /* nop */ - stl_p(p++, 0x03e00009); /* jalr ra= */ - stl_p(p++, 0xa1040000); /* sb a0,0= (t0) */ + stl_p(p++, 0x3c08b800); /* lui t0,0xb400 */ + stl_p(p++, 0x350803f8); /* ori t0,t0,0x3f8 */ + stl_p(p++, 0x91090005); /* lbu t1,5(t0) */ + stl_p(p++, 0x00000000); /* nop */ + stl_p(p++, 0x31290040); /* andi t1,t1,0x40 */ + stl_p(p++, 0x1120fffc); /* beqz t1,878 */ + stl_p(p++, 0x00000000); /* nop */ + stl_p(p++, 0x03e00009); /* jalr ra */ + stl_p(p++, 0xa1040000); /* sb a0,0(t0) */ =20 } =20 @@ -1242,7 +1244,7 @@ void mips_malta_init(MachineState *machine) /* * The whole address space decoded by the GT-64120A doesn't generate * exception when accessing invalid memory. Create an empty slot to - * emulate this feature.\ + * emulate this feature. */ empty_slot_init(0, 0x20000000); =20 diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/li= nux_ssh_mips_malta.py index fc13f9e..4db18de 100644 --- a/tests/acceptance/linux_ssh_mips_malta.py +++ b/tests/acceptance/linux_ssh_mips_malta.py @@ -99,10 +99,12 @@ class LinuxSSH(Test): def ssh_command(self, command, is_root=3DTrue): self.ssh_logger.info(command) result =3D self.ssh_session.cmd(command) - stdout_lines =3D [line.rstrip() for line in result.stdout_text.spl= itlines()] + stdout_lines =3D [line.rstrip() for line + in result.stdout_text.splitlines()] for line in stdout_lines: self.ssh_logger.info(line) - stderr_lines =3D [line.rstrip() for line in result.stderr_text.spl= itlines()] + stderr_lines =3D [line.rstrip() for line + in result.stderr_text.splitlines()] for line in stderr_lines: self.ssh_logger.warning(line) return stdout_lines, stderr_lines --=20 2.7.4