[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/10] hw/arm/realview: Simplify using 'break' statement
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 01/10] hw/arm/realview: Simplify using 'break' statement |
Date: |
Wed, 24 May 2023 16:58:57 +0200 |
The 'break' statement terminates the execution of the nearest
enclosing 'for' statement in which it appears.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/arm/realview.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index a5aa2f046a..a52ff35084 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -88,7 +88,6 @@ static void realview_init(MachineState *machine,
I2CBus *i2c;
int n;
unsigned int smp_cpus = machine->smp.cpus;
- int done_nic = 0;
qemu_irq cpu_irq[4];
int is_mpcore = 0;
int is_pb = 0;
@@ -294,14 +293,13 @@ static void realview_init(MachineState *machine,
for(n = 0; n < nb_nics; n++) {
nd = &nd_table[n];
- if (!done_nic && (!nd->model ||
- strcmp(nd->model, is_pb ? "lan9118" : "smc91c111") == 0)) {
+ if (!nd->model || strcmp(nd->model, is_pb ? "lan9118" : "smc91c111")
== 0) {
if (is_pb) {
lan9118_init(nd, 0x4e000000, pic[28]);
} else {
smc91c111_init(nd, 0x4e000000, pic[28]);
}
- done_nic = 1;
+ break;
} else {
if (pci_bus) {
pci_nic_init_nofail(nd, pci_bus, "rtl8139", NULL);
--
2.38.1
- [PATCH 00/10] hw/arm/realview: Introduce abstract RealviewMachineClass, Philippe Mathieu-Daudé, 2023/05/24
- [PATCH 03/10] hw/arm/realview: Introduce abstract RealviewMachineClass, Philippe Mathieu-Daudé, 2023/05/24
- [PATCH 02/10] hw/arm/realview: Declare QOM types using DEFINE_TYPES() macro, Philippe Mathieu-Daudé, 2023/05/24
- [PATCH 04/10] hw/arm/realview: Factor realview_common_class_init() out, Philippe Mathieu-Daudé, 2023/05/24
- [PATCH 01/10] hw/arm/realview: Simplify using 'break' statement,
Philippe Mathieu-Daudé <=
- [PATCH 05/10] hw/arm/realview: Move 'board_id' to RealviewMachineClass, Philippe Mathieu-Daudé, 2023/05/24
- [PATCH 07/10] hw/arm/realview: Move 'mpcore_periphbase' to RealviewMachineClass, Philippe Mathieu-Daudé, 2023/05/24
- [PATCH 06/10] hw/arm/realview: Move 'is_pb' to RealviewMachineClass, Philippe Mathieu-Daudé, 2023/05/24
- [PATCH 08/10] hw/arm/realview: Move 'loader_start' to RealviewMachineClass, Philippe Mathieu-Daudé, 2023/05/24