diff mbox series

[2/7] hw/isa: Use isa_address_space_io() to reduce access on global 'isabus'

Message ID 20230208000743.79415-3-philmd@linaro.org
State Superseded
Headers show
Series hw/ide: Untangle ISA/PCI abuses of ide_init_ioport() | expand

Commit Message

Philippe Mathieu-Daudé Feb. 8, 2023, 12:07 a.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/isa/isa-bus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Richard Henderson Feb. 8, 2023, 7:30 p.m. UTC | #1
On 2/7/23 14:07, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/isa/isa-bus.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~

> 
> diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
> index 5bd99379e9..95fc1ba5f7 100644
> --- a/hw/isa/isa-bus.c
> +++ b/hw/isa/isa-bus.c
> @@ -114,7 +114,7 @@ static inline void isa_init_ioport(ISADevice *dev, uint16_t ioport)
>   
>   void isa_register_ioport(ISADevice *dev, MemoryRegion *io, uint16_t start)
>   {
> -    memory_region_add_subregion(isabus->address_space_io, start, io);
> +    memory_region_add_subregion(isa_address_space_io(dev), start, io);
>       isa_init_ioport(dev, start);
>   }
>   
> @@ -133,7 +133,7 @@ int isa_register_portio_list(ISADevice *dev,
>       isa_init_ioport(dev, start);
>   
>       portio_list_register(piolist, OBJECT(dev), pio_start, opaque, name,
> -                         isabus->address_space_io, start);
> +                         isa_address_space_io(dev), start);
>   
>       return 0;
>   }
diff mbox series

Patch

diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index 5bd99379e9..95fc1ba5f7 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -114,7 +114,7 @@  static inline void isa_init_ioport(ISADevice *dev, uint16_t ioport)
 
 void isa_register_ioport(ISADevice *dev, MemoryRegion *io, uint16_t start)
 {
-    memory_region_add_subregion(isabus->address_space_io, start, io);
+    memory_region_add_subregion(isa_address_space_io(dev), start, io);
     isa_init_ioport(dev, start);
 }
 
@@ -133,7 +133,7 @@  int isa_register_portio_list(ISADevice *dev,
     isa_init_ioport(dev, start);
 
     portio_list_register(piolist, OBJECT(dev), pio_start, opaque, name,
-                         isabus->address_space_io, start);
+                         isa_address_space_io(dev), start);
 
     return 0;
 }