[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 42/49] hw/loongarch/virt: Checkpatch cleanup
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 42/49] hw/loongarch/virt: Checkpatch cleanup |
Date: |
Sun, 12 Jan 2025 23:17:18 +0100 |
From: Bibo Mao <maobibo@loongson.cn>
Code cleanup with directory hw/loongarch/, removing errors from
command "scripts/checkpatch.pl hw/loongarch/*"
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250103064514.2660438-1-maobibo@loongson.cn>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/loongarch/acpi-build.c | 3 ++-
hw/loongarch/boot.c | 4 ++--
hw/loongarch/virt.c | 8 +++++---
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/hw/loongarch/acpi-build.c b/hw/loongarch/acpi-build.c
index 9eb5fb68bff..fdd62acf7e9 100644
--- a/hw/loongarch/acpi-build.c
+++ b/hw/loongarch/acpi-build.c
@@ -456,8 +456,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
MachineState *machine)
acpi_table_begin(&table, table_data);
dsdt = init_aml_allocator();
- for (i = 0; i < VIRT_UART_COUNT; i++)
+ for (i = 0; i < VIRT_UART_COUNT; i++) {
build_uart_device_aml(dsdt, i);
+ }
build_pci_device_aml(dsdt, lvms);
build_la_ged_aml(dsdt, machine);
build_flash_aml(dsdt, lvms);
diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c
index 241c0eef1f0..bd8763c61c3 100644
--- a/hw/loongarch/boot.c
+++ b/hw/loongarch/boot.c
@@ -292,7 +292,7 @@ static void reset_load_elf(void *opaque)
cpu_reset(CPU(cpu));
if (env->load_elf) {
- if (cpu == LOONGARCH_CPU(first_cpu)) {
+ if (cpu == LOONGARCH_CPU(first_cpu)) {
env->gpr[4] = env->boot_info->a0;
env->gpr[5] = env->boot_info->a1;
env->gpr[6] = env->boot_info->a2;
@@ -354,7 +354,7 @@ static void loongarch_direct_kernel_boot(struct
loongarch_boot_info *info)
if (info->kernel_filename) {
kernel_addr = load_kernel_info(info);
} else {
- if(!qtest_enabled()) {
+ if (!qtest_enabled()) {
warn_report("No kernel provided, booting from flash drive.");
}
}
diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index df56d75a6e7..db37ed6a717 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -331,8 +331,9 @@ static void fdt_add_uart_node(LoongArchVirtMachineState
*lvms,
qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "ns16550a");
qemu_fdt_setprop_cells(ms->fdt, nodename, "reg", 0x0, base, 0x0, size);
qemu_fdt_setprop_cell(ms->fdt, nodename, "clock-frequency", 100000000);
- if (chosen)
+ if (chosen) {
qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", nodename);
+ }
qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", irq, 0x4);
qemu_fdt_setprop_cell(ms->fdt, nodename, "interrupt-parent",
*pch_pic_phandle);
@@ -815,7 +816,7 @@ static void virt_devices_init(DeviceState *pch_pic,
* Create uart fdt node in reverse order so that they appear
* in the finished device tree lowest address first
*/
- for (i = VIRT_UART_COUNT; i --> 0;) {
+ for (i = VIRT_UART_COUNT; i-- > 0;) {
hwaddr base = VIRT_UART_BASE + i * VIRT_UART_SIZE;
int irq = VIRT_UART_IRQ + i - VIRT_GSI_BASE;
serial_mm_init(get_system_memory(), base, 0,
@@ -1175,8 +1176,9 @@ static void fw_cfg_add_memory(MachineState *ms)
size = ram_size - numa_info[0].node_mem;
}
- if (size)
+ if (size) {
memmap_add_entry(base, size, 1);
+ }
}
static void virt_init(MachineState *machine)
--
2.47.1
- [PULL 33/49] hw/i2c/imx_i2c: Convert DPRINTF() to trace events, (continued)
- [PULL 33/49] hw/i2c/imx_i2c: Convert DPRINTF() to trace events, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 32/49] hw/char/imx_serial: Turn some DPRINTF() statements into trace events, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 34/49] hw/gpio/imx_gpio: Turn DPRINTF() into trace events, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 36/49] tests: Add functional tests for HPPA machines, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 30/49] tests/qtest/libqos: Reuse TYPE_IMX_I2C define, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 37/49] target/hppa: Convert hppa_cpu_init() to ResetHold handler, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 38/49] hw/hppa: Reset vCPUs calling resettable_reset(), Philippe Mathieu-Daudé, 2025/01/12
- [PULL 39/49] target/hppa: Only set PSW 'M' bit on reset, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 40/49] target/hppa: Set PC on vCPU reset, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 41/49] target/hppa: Speed up hppa_is_pa20(), Philippe Mathieu-Daudé, 2025/01/12
- [PULL 42/49] hw/loongarch/virt: Checkpatch cleanup,
Philippe Mathieu-Daudé <=
- [PULL 43/49] backends/cryptodev-vhost-user: Fix local_error leaks, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 44/49] hw/usb/hcd-xhci-pci: Use event ring 0 if mapping unsupported, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 45/49] hw/tricore/triboard: Remove unnecessary use of &first_cpu, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 46/49] MAINTAINERS: remove myself from sbsa-ref, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 47/49] MAINTAINERS: Add me as the maintainer for ivshmem-flat, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 48/49] MAINTAINERS: Update path to coreaudio.m, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 49/49] Add a b4 configuration file, Philippe Mathieu-Daudé, 2025/01/12
- Re: [PULL 00/49] Misc HW patches for 2025-01-12, Philippe Mathieu-Daudé, 2025/01/13