]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
cputlb: simplify tlb_set_page
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 May 2013 14:45:30 +0000 (16:45 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 29 May 2013 14:26:39 +0000 (16:26 +0200)
The same "if" condition is repeated twice.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cputlb.c

index aba7e44e1e424fa618272e39b4607d92c5d56839..b56bc0102cb7d93fd412afeefc9702adb24177a0 100644 (file)
--- a/cputlb.c
+++ b/cputlb.c
@@ -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;