mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-09-18 22:14:16 +00:00 
			
		
		
		
	mm: page_alloc: use div64_ul() instead of do_div()
Fixes Coccinelle/coccicheck warning reported by do_div.cocci. Compared to do_div(), div64_ul() does not implicitly cast the divisor and does not unnecessarily calculate the remainder. Link: https://lkml.kernel.org/r/20240228224911.1164-2-thorsten.blum@toblux.com Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
		
							parent
							
								
									f1cce6f7fa
								
							
						
					
					
						commit
						72741db683
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -5848,7 +5848,7 @@ static void __setup_per_zone_wmarks(void) | |||
| 
 | ||||
| 		spin_lock_irqsave(&zone->lock, flags); | ||||
| 		tmp = (u64)pages_min * zone_managed_pages(zone); | ||||
| 		do_div(tmp, lowmem_pages); | ||||
| 		tmp = div64_ul(tmp, lowmem_pages); | ||||
| 		if (is_highmem(zone) || zone_idx(zone) == ZONE_MOVABLE) { | ||||
| 			/*
 | ||||
| 			 * __GFP_HIGH and PF_MEMALLOC allocations usually don't | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Thorsten Blum
						Thorsten Blum