mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	mm/memory.c: use helper macro min and max in unmap_mapping_range_tree()
Use helper macro min and max to help simplify the code logic. Minor readability improvement. Link: https://lkml.kernel.org/r/20220224121134.35068-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
		
							parent
							
								
									88a359125a
								
							
						
					
					
						commit
						f9871da927
					
				
					 1 changed files with 2 additions and 6 deletions
				
			
		| 
						 | 
					@ -3350,12 +3350,8 @@ static inline void unmap_mapping_range_tree(struct rb_root_cached *root,
 | 
				
			||||||
	vma_interval_tree_foreach(vma, root, first_index, last_index) {
 | 
						vma_interval_tree_foreach(vma, root, first_index, last_index) {
 | 
				
			||||||
		vba = vma->vm_pgoff;
 | 
							vba = vma->vm_pgoff;
 | 
				
			||||||
		vea = vba + vma_pages(vma) - 1;
 | 
							vea = vba + vma_pages(vma) - 1;
 | 
				
			||||||
		zba = first_index;
 | 
							zba = max(first_index, vba);
 | 
				
			||||||
		if (zba < vba)
 | 
							zea = min(last_index, vea);
 | 
				
			||||||
			zba = vba;
 | 
					 | 
				
			||||||
		zea = last_index;
 | 
					 | 
				
			||||||
		if (zea > vea)
 | 
					 | 
				
			||||||
			zea = vea;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		unmap_mapping_range_vma(vma,
 | 
							unmap_mapping_range_vma(vma,
 | 
				
			||||||
			((zba - vba) << PAGE_SHIFT) + vma->vm_start,
 | 
								((zba - vba) << PAGE_SHIFT) + vma->vm_start,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue