diff options
author | Paolo Bonzini | 2020-11-03 09:26:05 +0100 |
---|---|---|
committer | Paolo Bonzini | 2020-12-10 18:15:19 +0100 |
commit | 46ee119fb64570c6efdff3342fbec3e86267bda3 (patch) | |
tree | 4c3e4950b8d7db44635e7af88eadb45f74c03932 /hw/ppc | |
parent | vl: extract softmmu/rtc.c (diff) | |
download | qemu-46ee119fb64570c6efdff3342fbec3e86267bda3.tar.gz qemu-46ee119fb64570c6efdff3342fbec3e86267bda3.tar.xz qemu-46ee119fb64570c6efdff3342fbec3e86267bda3.zip |
vl: remove serial_max_hds
serial_hd(i) is NULL if and only if i >= serial_max_hds(). Test
serial_hd(i) instead of bounding the loop at serial_max_hds(),
thus removing one more function that vl.c is expected to export.
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/ppc')
-rw-r--r-- | hw/ppc/spapr.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 3f5b0d0159..6abb45d0ed 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2878,10 +2878,8 @@ static void spapr_machine_init(MachineState *machine) /* Set up VIO bus */ spapr->vio_bus = spapr_vio_bus_init(); - for (i = 0; i < serial_max_hds(); i++) { - if (serial_hd(i)) { - spapr_vty_create(spapr->vio_bus, serial_hd(i)); - } + for (i = 0; serial_hd(i); i++) { + spapr_vty_create(spapr->vio_bus, serial_hd(i)); } /* We always have at least the nvram device on VIO */ |