mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-11-01 09:13:37 +00:00 
			
		
		
		
	davinci: psc: simplify if-statement
A common do-while loop can be factored out from the end of the branches. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
This commit is contained in:
		
							parent
							
								
									ced98628bf
								
							
						
					
					
						commit
						1a07bfb521
					
				
					 1 changed files with 4 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -83,20 +83,15 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr,
 | 
			
		|||
		pdctl1 = __raw_readl(psc_base + PDCTL1);
 | 
			
		||||
		pdctl1 |= 0x100;
 | 
			
		||||
		__raw_writel(pdctl1, psc_base + PDCTL1);
 | 
			
		||||
 | 
			
		||||
		do {
 | 
			
		||||
			ptstat = __raw_readl(psc_base +
 | 
			
		||||
					       PTSTAT);
 | 
			
		||||
		} while (!(((ptstat >> domain) & 1) == 0));
 | 
			
		||||
	} else {
 | 
			
		||||
		ptcmd = 1 << domain;
 | 
			
		||||
		__raw_writel(ptcmd, psc_base + PTCMD);
 | 
			
		||||
 | 
			
		||||
		do {
 | 
			
		||||
			ptstat = __raw_readl(psc_base + PTSTAT);
 | 
			
		||||
		} while (!(((ptstat >> domain) & 1) == 0));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	do {
 | 
			
		||||
		ptstat = __raw_readl(psc_base + PTSTAT);
 | 
			
		||||
	} while (!(((ptstat >> domain) & 1) == 0));
 | 
			
		||||
 | 
			
		||||
	do {
 | 
			
		||||
		mdstat = __raw_readl(psc_base + MDSTAT + 4 * id);
 | 
			
		||||
	} while (!((mdstat & MDSTAT_STATE_MASK) == next_state));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue