[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 079/113] vl: remove serial_max_hds
From: |
Paolo Bonzini |
Subject: |
[PULL 079/113] vl: remove serial_max_hds |
Date: |
Wed, 2 Dec 2020 03:08:15 -0500 |
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>
---
hw/ppc/spapr.c | 6 ++----
include/sysemu/sysemu.h | 4 ----
softmmu/vl.c | 5 -----
3 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 049efa0bbf..b7e0894019 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 */
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 18cf586cd0..29c32f9851 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -71,10 +71,6 @@ void hmp_pcie_aer_inject_error(Monitor *mon, const QDict
*qdict);
/* Return the Chardev for serial port i, or NULL if none */
Chardev *serial_hd(int i);
-/* return the number of serial ports defined by the user. serial_hd(i)
- * will always return NULL for any i which is greater than or equal to this.
- */
-int serial_max_hds(void);
/* parallel ports */
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 4c95537af3..43a0a45b68 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2159,11 +2159,6 @@ Chardev *serial_hd(int i)
return NULL;
}
-int serial_max_hds(void)
-{
- return num_serial_hds;
-}
-
static int parallel_parse(const char *devname)
{
static int index = 0;
--
2.26.2
- [PULL 087/113] scripts: kernel-doc: accept negation like !@var, (continued)
- [PULL 087/113] scripts: kernel-doc: accept negation like !@var, Paolo Bonzini, 2020/12/02
- [PULL 069/113] vl: separate qemu_apply_machine_options, Paolo Bonzini, 2020/12/02
- [PULL 051/113] treewide: do not use short-form boolean options, Paolo Bonzini, 2020/12/02
- [PULL 056/113] vl: extract qemu_init_subsystems, Paolo Bonzini, 2020/12/02
- [PULL 060/113] vl: extract various command line desugaring snippets to a new function, Paolo Bonzini, 2020/12/02
- [PULL 061/113] qemu-option: restrict qemu_opts_set to merge-lists QemuOpts, Paolo Bonzini, 2020/12/02
- [PULL 067/113] vl: separate qemu_create_late_backends, Paolo Bonzini, 2020/12/02
- [PULL 072/113] vl: move -global check earlier, Paolo Bonzini, 2020/12/02
- [PULL 073/113] migration, vl: start migration via qmp_migrate_incoming, Paolo Bonzini, 2020/12/02
- [PULL 068/113] vl: separate qemu_create_machine, Paolo Bonzini, 2020/12/02
- [PULL 079/113] vl: remove serial_max_hds,
Paolo Bonzini <=
- [PULL 075/113] hmp: introduce cmd_available, Paolo Bonzini, 2020/12/02
- [PULL 077/113] vl: extract machine done notifiers, Paolo Bonzini, 2020/12/02
- [PULL 094/113] kernel-doc: add support for ____cacheline_aligned attribute, Paolo Bonzini, 2020/12/02
- [PULL 096/113] Revert "scripts/kerneldoc: For Sphinx 3 use c:macro for macros with arguments", Paolo Bonzini, 2020/12/02
- [PULL 083/113] kernel-doc: fix processing nested structs with attributes, Paolo Bonzini, 2020/12/02
- [PULL 082/113] docs: temporarily disable the kernel-doc extension, Paolo Bonzini, 2020/12/02
- [PULL 081/113] config-file: move -set implementation to vl.c, Paolo Bonzini, 2020/12/02
- [PULL 085/113] scripts/kernel-doc: Add support for named variable macro arguments, Paolo Bonzini, 2020/12/02
- [PULL 089/113] Replace HTTP links with HTTPS ones: documentation, Paolo Bonzini, 2020/12/02
- [PULL 092/113] scripts/kernel-doc: optionally treat warnings as errors, Paolo Bonzini, 2020/12/02