qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 03/22] cputlb: simplify tlb_set_page


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH 03/22] cputlb: simplify tlb_set_page
Date: Fri, 24 May 2013 19:05:38 +0200

The same "if" condition is repeated twice.

Signed-off-by: Paolo Bonzini <address@hidden>
---
 cputlb.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/cputlb.c b/cputlb.c
index aba7e44..b56bc01 100644
--- 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;
-- 
1.8.1.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]