mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
Avoid range comparisons on io index types
The code sometimes uses range comparisons on io indexes (e.g. index =< IO_MEM_ROM). Avoid these as they make moving to objects harder. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
2774c6d0ae
commit
1d393fa2d1
4 changed files with 27 additions and 21 deletions
3
memory.c
3
memory.c
|
@ -312,7 +312,8 @@ static void as_memory_range_add(AddressSpace *as, FlatRange *fr)
|
|||
/* cpu_register_physical_memory_log() wants region_offset for
|
||||
* mmio, but prefers offseting phys_offset for RAM. Humour it.
|
||||
*/
|
||||
if ((phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM) {
|
||||
if ((phys_offset & ~TARGET_PAGE_MASK) == IO_MEM_RAM
|
||||
|| (phys_offset & ~TARGET_PAGE_MASK) == IO_MEM_ROM) {
|
||||
phys_offset += region_offset;
|
||||
region_offset = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue