[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 09/18] hw/isa: Simplify isa_address_space[_io]()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 09/18] hw/isa: Simplify isa_address_space[_io]() |
Date: |
Wed, 15 Feb 2023 17:16:32 +0100 |
We don't have any caller passing a NULL device argument,
so we can simplify, avoiding to access the global 'isabus'.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/isa/isa-bus.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index a9b94e6c8a..08c84704e9 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -247,20 +247,14 @@ static char *isabus_get_fw_dev_path(DeviceState *dev)
MemoryRegion *isa_address_space(ISADevice *dev)
{
- if (dev) {
- return isa_bus_from_device(dev)->address_space;
- }
-
- return isabus->address_space;
+ assert(dev);
+ return isa_bus_from_device(dev)->address_space;
}
MemoryRegion *isa_address_space_io(ISADevice *dev)
{
- if (dev) {
- return isa_bus_from_device(dev)->address_space_io;
- }
-
- return isabus->address_space_io;
+ assert(dev);
+ return isa_bus_from_device(dev)->address_space_io;
}
type_init(isabus_register_types)
--
2.38.1
- [PATCH v2 06/18] hw/isa/piix4: Wire PIIX4 IDE ouput IRQs to ISA bus IRQs 14/15, (continued)
- [PATCH v2 06/18] hw/isa/piix4: Wire PIIX4 IDE ouput IRQs to ISA bus IRQs 14/15, Philippe Mathieu-Daudé, 2023/02/15
- [PATCH v2 07/18] hw/ide/piix: Ensure IDE output IRQs are wired at realization, Philippe Mathieu-Daudé, 2023/02/15
- Re: [PATCH v2 07/18] hw/ide/piix: Ensure IDE output IRQs are wired at realization, Bernhard Beschow, 2023/02/16
- Re: [PATCH v2 07/18] hw/ide/piix: Ensure IDE output IRQs are wired at realization, Philippe Mathieu-Daudé, 2023/02/16
- Re: [PATCH v2 07/18] hw/ide/piix: Ensure IDE output IRQs are wired at realization, Bernhard Beschow, 2023/02/16
- Re: [PATCH v2 07/18] hw/ide/piix: Ensure IDE output IRQs are wired at realization, Philippe Mathieu-Daudé, 2023/02/19
- Re: [PATCH v2 07/18] hw/ide/piix: Ensure IDE output IRQs are wired at realization, Bernhard Beschow, 2023/02/20
- Re: [PATCH v2 07/18] hw/ide/piix: Ensure IDE output IRQs are wired at realization, BALATON Zoltan, 2023/02/20
- Re: [PATCH v2 07/18] hw/ide/piix: Ensure IDE output IRQs are wired at realization, Daniel P . Berrangé, 2023/02/21
[PATCH v2 08/18] hw/isa: Deprecate isa_get_irq() in favor of isa_bus_get_irq(), Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 09/18] hw/isa: Simplify isa_address_space[_io](),
Philippe Mathieu-Daudé <=
[PATCH v2 10/18] hw/isa: Use isa_address_space_io() in isa_register_ioport(), Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 12/18] hw/ide: Rename ISA specific ide_init_ioport -> ide_bus_init_ioport_isa, Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 11/18] hw/ide: Declare ide_get_[geometry/bios_chs_trans] in 'hw/ide/internal.h', Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 14/18] hw/ide/piix: Use generic ide_bus_init_ioport(), Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 13/18] hw/ide: Introduce generic ide_init_ioport(), Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 15/18] hw/isa: Ensure isa_register_portio_list() do not get NULL ISA device, Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 16/18] hw/isa: Reduce 'isabus' singleton scope to isa_bus_new(), Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 17/18] hw/isa: Un-inline isa_bus_from_device(), Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 18/18] hw/isa: Remove empty ISADeviceClass structure, Philippe Mathieu-Daudé, 2023/02/15