From nobody Wed Nov 12 23:19:33 2025 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=1574687410; cv=none; d=zohomail.com; s=zohoarc; b=f0qcV2vq0m1AnjgrykMKSb321o7v9JT1/8StnemSc4WoeI/+uIssYBwVZJdEipBEW+ip5BnEFTf9R11QDOGgSVhM8H0pl29MeiV4NOJdCpYuhctNURKm2Q+A6/p3MaEQOfREu9qKytKF4ZbWOEg8er/OxgXInNGkbjs+z6vg6n8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574687410; 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=dvWjzMkqLVWjqsL8BqnPwxas0CdS9jawd+aaoGv8xro=; b=Iq18e29pQvBXEdpAcrF1F76fN/y00NmYFjVvUWKL3Oal2ZM2GDYcsirn2cLP3SOuqOztTP+MSanRfuBkPoZvI1dbE7dNT9Ub9qYm7AoSWugQxMBCswHXESXPtwdmCdDOIxZCEq4la5736ssoihYIHTeQ1qdgaM9d3MBfTSpUDow= 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 1574687410375420.14751668654696; Mon, 25 Nov 2019 05:10:10 -0800 (PST) Received: from localhost ([::1]:43696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZE80-0007n6-R8 for importer@patchew.org; Mon, 25 Nov 2019 08:10:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39319) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZE4D-0004dB-UV for qemu-devel@nongnu.org; Mon, 25 Nov 2019 08:06:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZE4C-00069t-6a for qemu-devel@nongnu.org; Mon, 25 Nov 2019 08:06:13 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:45543 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 1iZE4B-0005Ra-Po for qemu-devel@nongnu.org; Mon, 25 Nov 2019 08:06:12 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id AA2BC1A225E; Mon, 25 Nov 2019 14:05:05 +0100 (CET) Received: from rtrkw493-lin.domain.local (rtrkw493-lin.domain.local [10.10.14.93]) by mail.rt-rk.com (Postfix) with ESMTPSA id 70E0E1A2251; Mon, 25 Nov 2019 14:05:05 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Filip Bozuta To: qemu-devel@nongnu.org Subject: [PATCH 4/5] mips: r4000: Renovate coding style Date: Mon, 25 Nov 2019 14:04:57 +0100 Message-Id: <1574687098-26689-5-git-send-email-Filip.Bozuta@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1574687098-26689-1-git-send-email-Filip.Bozuta@rt-rk.com> References: <1574687098-26689-1-git-send-email-Filip.Bozuta@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: pburton@wavecomp.com, aleksandar.rikalo@rt-rk.com, hpoussin@reactos.org, amarkovic@wavecomp.com, aurelien@aurel32.net 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" The script checkpatch.pl located in scripts folder was used to detect all errors and warrnings in file: hw/mips/mips_r4k.c This mips r4000 machine file was 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 Reviewed-by: Aleksandar Markovic --- hw/mips/mips_r4k.c | 55 +++++++++++++++++++++++++++++++++-----------------= ---- 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index 7002423..d638358 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -6,7 +6,7 @@ * ISA memory at the 0x10000000 (PHYS, 16Mb in size). * All peripherial devices are attached to this "bus" with * the standard PC ISA addresses. -*/ + */ =20 #include "qemu/osdep.h" #include "qemu/units.h" @@ -54,17 +54,18 @@ static struct _loaderparams { const char *initrd_filename; } loaderparams; =20 -static void mips_qemu_write (void *opaque, hwaddr addr, - uint64_t val, unsigned size) +static void mips_qemu_write(void *opaque, hwaddr addr, + uint64_t val, unsigned size) { - if ((addr & 0xffff) =3D=3D 0 && val =3D=3D 42) + if ((addr & 0xffff) =3D=3D 0 && val =3D=3D 42) { qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); - else if ((addr & 0xffff) =3D=3D 4 && val =3D=3D 42) + } else if ((addr & 0xffff) =3D=3D 4 && val =3D=3D 42) { qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + } } =20 -static uint64_t mips_qemu_read (void *opaque, hwaddr addr, - unsigned size) +static uint64_t mips_qemu_read(void *opaque, hwaddr addr, + unsigned size) { return 0; } @@ -100,8 +101,9 @@ static int64_t load_kernel(void) (uint64_t *)&kernel_high, big_endian, EM_MIPS, 1, 0); if (kernel_size >=3D 0) { - if ((entry & ~0x7fffffffULL) =3D=3D 0x80000000) + if ((entry & ~0x7fffffffULL) =3D=3D 0x80000000) { entry =3D (int32_t)entry; + } } else { error_report("could not load kernel '%s': %s", loaderparams.kernel_filename, @@ -113,9 +115,10 @@ static int64_t load_kernel(void) initrd_size =3D 0; initrd_offset =3D 0; if (loaderparams.initrd_filename) { - initrd_size =3D get_image_size (loaderparams.initrd_filename); + initrd_size =3D get_image_size(loaderparams.initrd_filename); if (initrd_size > 0) { - initrd_offset =3D (kernel_high + ~INITRD_PAGE_MASK) & INITRD_P= AGE_MASK; + initrd_offset =3D (kernel_high + ~INITRD_PAGE_MASK) & + INITRD_PAGE_MASK; if (initrd_offset + initrd_size > ram_size) { error_report("memory too small for initial ram disk '%s'", loaderparams.initrd_filename); @@ -139,11 +142,13 @@ static int64_t load_kernel(void) params_buf[1] =3D tswap32(0x12345678); =20 if (initrd_size > 0) { - snprintf((char *)params_buf + 8, 256, "rd_start=3D0x%" PRIx64 " rd= _size=3D%" PRId64 " %s", + snprintf((char *)params_buf + 8, 256, + "rd_start=3D0x%" PRIx64 " rd_size=3D%" PRId64 " %s", cpu_mips_phys_to_kseg0(NULL, initrd_offset), initrd_size, loaderparams.kernel_cmdline); } else { - snprintf((char *)params_buf + 8, 256, "%s", loaderparams.kernel_cm= dline); + snprintf((char *)params_buf + 8, 256, + "%s", loaderparams.kernel_cmdline); } =20 rom_add_blob_fixed("params", params_buf, params_size, @@ -207,15 +212,21 @@ void mips_r4k_init(MachineState *machine) =20 memory_region_add_subregion(address_space_mem, 0, ram); =20 - memory_region_init_io(iomem, NULL, &mips_qemu_ops, NULL, "mips-qemu", = 0x10000); + memory_region_init_io(iomem, NULL, &mips_qemu_ops, + NULL, "mips-qemu", 0x10000); + memory_region_add_subregion(address_space_mem, 0x1fbf0000, iomem); =20 - /* Try to load a BIOS image. If this fails, we continue regardless, - but initialize the hardware ourselves. When a kernel gets - preloaded we also initialize the hardware, since the BIOS wasn't - run. */ - if (bios_name =3D=3D NULL) + /* + * Try to load a BIOS image. If this fails, we continue regardless, + * but initialize the hardware ourselves. When a kernel gets + * preloaded we also initialize the hardware, since the BIOS wasn't + * run. + */ + + if (bios_name =3D=3D NULL) { bios_name =3D BIOS_FILENAME; + } filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); if (filename) { bios_size =3D get_image_size(filename); @@ -227,6 +238,7 @@ void mips_r4k_init(MachineState *machine) #else be =3D 0; #endif + dinfo =3D drive_get(IF_PFLASH, 0, 0); if ((bios_size > 0) && (bios_size <=3D BIOS_SIZE)) { bios =3D g_new(MemoryRegion, 1); memory_region_init_ram(bios, NULL, "mips_r4k.bios", BIOS_SIZE, @@ -235,7 +247,7 @@ void mips_r4k_init(MachineState *machine) memory_region_add_subregion(get_system_memory(), 0x1fc00000, bios); =20 load_image_targphys(filename, 0x1fc00000, BIOS_SIZE); - } else if ((dinfo =3D drive_get(IF_PFLASH, 0, 0)) !=3D NULL) { + } else if (dinfo !=3D NULL) { uint32_t mips_rom =3D 0x00400000; if (!pflash_cfi01_register(0x1fc00000, "mips_r4k.bios", mips_rom, blk_by_legacy_dinfo(dinfo), @@ -280,11 +292,12 @@ void mips_r4k_init(MachineState *machine) =20 isa_vga_init(isa_bus); =20 - if (nd_table[0].used) + if (nd_table[0].used) { isa_ne2000_init(isa_bus, 0x300, 9, &nd_table[0]); + } =20 ide_drive_get(hd, ARRAY_SIZE(hd)); - for(i =3D 0; i < MAX_IDE_BUS; i++) + for (i =3D 0; i < MAX_IDE_BUS; i++) isa_ide_init(isa_bus, ide_iobase[i], ide_iobase2[i], ide_irq[i], hd[MAX_IDE_DEVS * i], hd[MAX_IDE_DEVS * i + 1]); --=20 2.7.4