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>
This commit is contained in:
		
							parent
							
								
									ae4e43e80f
								
							
						
					
					
						commit
						8f3e03cb73
					
				
							
								
								
									
										13
									
								
								cputlb.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								cputlb.c
									
									
									
									
									
								
							@ -262,17 +262,14 @@ void tlb_set_page(CPUArchState *env, target_ulong vaddr,
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    address = vaddr;
 | 
					    address = vaddr;
 | 
				
			||||||
    if (!(memory_region_is_ram(section->mr) ||
 | 
					    if (!memory_region_is_ram(section->mr) && !memory_region_is_romd(section->mr)) {
 | 
				
			||||||
          memory_region_is_romd(section->mr))) {
 | 
					        /* IO memory case */
 | 
				
			||||||
        /* IO memory case (romd handled later) */
 | 
					 | 
				
			||||||
        address |= TLB_MMIO;
 | 
					        address |= TLB_MMIO;
 | 
				
			||||||
    }
 | 
					        addend = 0;
 | 
				
			||||||
    if (memory_region_is_ram(section->mr) ||
 | 
					    } else {
 | 
				
			||||||
        memory_region_is_romd(section->mr)) {
 | 
					        /* TLB_MMIO for rom/romd handled below */
 | 
				
			||||||
        addend = (uintptr_t)memory_region_get_ram_ptr(section->mr)
 | 
					        addend = (uintptr_t)memory_region_get_ram_ptr(section->mr)
 | 
				
			||||||
        + memory_region_section_addr(section, paddr);
 | 
					        + memory_region_section_addr(section, paddr);
 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
        addend = 0;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    code_address = address;
 | 
					    code_address = address;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user