All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: Nicolas Kaiser <nikai@nikai.net>
Cc: davinci-linux-open-source@linux.davincidsp.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] davinci: simplify if-statement
Date: Fri, 12 Nov 2010 08:07:07 -0800	[thread overview]
Message-ID: <8739r6sez8.fsf@deeprootsystems.com> (raw)
In-Reply-To: <20101025144118.62ec420c@absol.kitzblitz> (Nicolas Kaiser's message of "Mon, 25 Oct 2010 14:41:18 +0200")

Nicolas Kaiser <nikai@nikai.net> writes:

> A common do-while loop can be factored out from the end of
> the branches.
>
> Signed-off-by: Nicolas Kaiser <nikai@nikai.net>

Applied, queueing for 2.6.38.

Kevin

> ---
>  arch/arm/mach-davinci/psc.c |   13 ++++---------
>  1 files changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/psc.c b/arch/arm/mach-davinci/psc.c
> index 1b15dbd..a415804 100644
> --- a/arch/arm/mach-davinci/psc.c
> +++ b/arch/arm/mach-davinci/psc.c
> @@ -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));

      reply	other threads:[~2010-11-12 16:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-25 12:41 [PATCH] davinci: simplify if-statement Nicolas Kaiser
2010-11-12 16:07 ` Kevin Hilman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8739r6sez8.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nikai@nikai.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.