From: Paolo Bonzini Date: Fri, 24 May 2013 14:45:30 +0000 (+0200) Subject: cputlb: simplify tlb_set_page X-Git-Tag: qemu-xen-4.4.0-rc1~6^2~343^2~19 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=8f3e03cb73dce9eac207cfe0f37d87d6490421a0;p=qemu-upstream-4.5-testing.git cputlb: simplify tlb_set_page The same "if" condition is repeated twice. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- diff --git a/cputlb.c b/cputlb.c index aba7e44e1..b56bc0102 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;