davinci: simplify if-statement
Subsystems (3)
PATCH 1/1 davinci: simplify if-statement
A common do-while loop can be factored out from the end of the branches.
Signed-off-by Nicolas Kaiser <[email protected]>
--- arch/arm/mach-davinci/psc.c | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-)
arch/arm/mach-davinci/psc.c +4 -9
@@ -83,21 +83,16 @@ 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));
Signature · 1 line
1.7.2.2
Kevin Hilman
AppliedQuoted 4 lines · Nicolas Kaiser
A common do-while loop can be factored out from the end of the branches.
Signed-off-by Nicolas Kaiser <[email protected]>
Applied, queueing for 2.6.38.
Kevin
Quoted 33 lines
--- arch/arm/mach-davinci/psc.c | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-)arch/arm/mach-davinci/psc.c +4
-9@@ -83,21 +83,16 @@ 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));