Skip to content

Commit

Permalink
davinci: psc: simplify if-statement
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Kaiser authored and Kevin Hilman committed Dec 10, 2010
1 parent ced9862 commit 1a07bfb
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions arch/arm/mach-davinci/psc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 1a07bfb

Please sign in to comment.