Skip to content

Commit c48cc87

Browse files
bibo-maophilmd
authored andcommitted
hw/loongarch/virt: Checkpatch cleanup
Code cleanup with directory hw/loongarch/, removing errors from command "scripts/checkpatch.pl hw/loongarch/*" Signed-off-by: Bibo Mao <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Message-ID: <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
1 parent 5c27cbd commit c48cc87

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

hw/loongarch/acpi-build.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, MachineState *machine)
456456

457457
acpi_table_begin(&table, table_data);
458458
dsdt = init_aml_allocator();
459-
for (i = 0; i < VIRT_UART_COUNT; i++)
459+
for (i = 0; i < VIRT_UART_COUNT; i++) {
460460
build_uart_device_aml(dsdt, i);
461+
}
461462
build_pci_device_aml(dsdt, lvms);
462463
build_la_ged_aml(dsdt, machine);
463464
build_flash_aml(dsdt, lvms);

hw/loongarch/boot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ static void reset_load_elf(void *opaque)
292292

293293
cpu_reset(CPU(cpu));
294294
if (env->load_elf) {
295-
if (cpu == LOONGARCH_CPU(first_cpu)) {
295+
if (cpu == LOONGARCH_CPU(first_cpu)) {
296296
env->gpr[4] = env->boot_info->a0;
297297
env->gpr[5] = env->boot_info->a1;
298298
env->gpr[6] = env->boot_info->a2;
@@ -354,7 +354,7 @@ static void loongarch_direct_kernel_boot(struct loongarch_boot_info *info)
354354
if (info->kernel_filename) {
355355
kernel_addr = load_kernel_info(info);
356356
} else {
357-
if(!qtest_enabled()) {
357+
if (!qtest_enabled()) {
358358
warn_report("No kernel provided, booting from flash drive.");
359359
}
360360
}

hw/loongarch/virt.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,9 @@ static void fdt_add_uart_node(LoongArchVirtMachineState *lvms,
331331
qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "ns16550a");
332332
qemu_fdt_setprop_cells(ms->fdt, nodename, "reg", 0x0, base, 0x0, size);
333333
qemu_fdt_setprop_cell(ms->fdt, nodename, "clock-frequency", 100000000);
334-
if (chosen)
334+
if (chosen) {
335335
qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", nodename);
336+
}
336337
qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", irq, 0x4);
337338
qemu_fdt_setprop_cell(ms->fdt, nodename, "interrupt-parent",
338339
*pch_pic_phandle);
@@ -815,7 +816,7 @@ static void virt_devices_init(DeviceState *pch_pic,
815816
* Create uart fdt node in reverse order so that they appear
816817
* in the finished device tree lowest address first
817818
*/
818-
for (i = VIRT_UART_COUNT; i --> 0;) {
819+
for (i = VIRT_UART_COUNT; i-- > 0;) {
819820
hwaddr base = VIRT_UART_BASE + i * VIRT_UART_SIZE;
820821
int irq = VIRT_UART_IRQ + i - VIRT_GSI_BASE;
821822
serial_mm_init(get_system_memory(), base, 0,
@@ -1175,8 +1176,9 @@ static void fw_cfg_add_memory(MachineState *ms)
11751176
size = ram_size - numa_info[0].node_mem;
11761177
}
11771178

1178-
if (size)
1179+
if (size) {
11791180
memmap_add_entry(base, size, 1);
1181+
}
11801182
}
11811183

11821184
static void virt_init(MachineState *machine)

0 commit comments

Comments
 (0)