public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/1] irqchip: imx-gpcv2: Simplify the implemenation
Date: Wed, 26 Aug 2015 18:00:24 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.11.1508261756540.15006@nanos> (raw)
In-Reply-To: <1440604166-2624-1-git-send-email-shenwei.wang@freescale.com>

On Wed, 26 Aug 2015, Shenwei Wang wrote:
>  u32 imx_gpcv2_get_wakeup_source(u32 **sources)
>  {
> -	if (!imx_gpcv2_instance)
> +	struct gpcv2_irqchip_data *cd;
> +	void __iomem *reg;
> +	int i;
> +
> +	cd = imx_gpcv2_instance;
> +	if (!cd)
>  		return 0;
>  
> +	for (i = 0; i < IMR_NUM; i++) {
> +		reg = cd->gpc_base + cd->cpu2wakeup + i * 4;
> +		cd->wakeup_sources[i] = readl_relaxed(reg);
> +	}
> +
>  	if (sources)
> -		*sources = imx_gpcv2_instance->wakeup_sources;
> +		*sources = cd->wakeup_sources;
>  
>  	return IMR_NUM;

You do not need the intermediate storage at all.

u32 imx_gpcv2_get_wakeup_source(u32 *sources)
{
	if (sources) {
		for (i = 0; i < IMR_NUM; i++) {
			reg = cd->gpc_base + cd->cpu2wakeup + i * 4;
			sources[i] = readl_relaxed(reg);
		}
	}
	....

Hmm?

  reply	other threads:[~2015-08-26 16:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26 15:49 [PATCH 1/1] irqchip: imx-gpcv2: Simplify the implemenation Shenwei Wang
2015-08-26 16:00 ` Thomas Gleixner [this message]
2015-08-26 16:32   ` Shenwei Wang
2015-08-26 18:54     ` Thomas Gleixner
2015-08-26 19:05       ` Shenwei Wang
2015-08-26 16:12 ` Sudeep Holla
2015-08-26 16:44   ` Shenwei Wang
2015-08-26 17:10     ` Sudeep Holla

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=alpine.DEB.2.11.1508261756540.15006@nanos \
    --to=tglx@linutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox