diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-05-24 16:45:30 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-05-29 16:26:39 +0200 |
commit | 8f3e03cb73dce9eac207cfe0f37d87d6490421a0 (patch) | |
tree | 1b548de8532fd23e68152dd04e8eae84050a63c4 /cputlb.c | |
parent | ae4e43e80f3e1e65d096ebbc643eed9d763e1441 (diff) | |
download | qemu-8f3e03cb73dce9eac207cfe0f37d87d6490421a0.zip qemu-8f3e03cb73dce9eac207cfe0f37d87d6490421a0.tar.gz qemu-8f3e03cb73dce9eac207cfe0f37d87d6490421a0.tar.bz2 |
cputlb: simplify tlb_set_page
The same "if" condition is repeated twice.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'cputlb.c')
-rw-r--r-- | cputlb.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -262,17 +262,14 @@ void tlb_set_page(CPUArchState *env, target_ulong vaddr, #endif address = vaddr; - if (!(memory_region_is_ram(section->mr) || - memory_region_is_romd(section->mr))) { - /* IO memory case (romd handled later) */ + if (!memory_region_is_ram(section->mr) && !memory_region_is_romd(section->mr)) { + /* IO memory case */ address |= TLB_MMIO; - } - if (memory_region_is_ram(section->mr) || - memory_region_is_romd(section->mr)) { + addend = 0; + } else { + /* TLB_MMIO for rom/romd handled below */ addend = (uintptr_t)memory_region_get_ram_ptr(section->mr) + memory_region_section_addr(section, paddr); - } else { - addend = 0; } code_address = address; |