mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: yalin wang <yalin.wang2010@gmail.com>
Cc: vinod.koul@intel.com, dan.j.williams@intel.com, robh@kernel.org,
	jiang.liu@linux.intel.com, dmaengine@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dma/ipu: change ipu_irq_handler() to remove compile warning
Date: Tue, 25 Aug 2015 10:07:46 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.11.1508251001560.15006@nanos> (raw)
In-Reply-To: <1440489668-3139-1-git-send-email-yalin.wang2010@gmail.com>

On Tue, 25 Aug 2015, yalin wang wrote:
> Change ipu_irq_handler() to avoid gcc warning:
> 
> drivers/dma/ipu/ipu_irq.c:305:4: warning: 'irq' may be used
> uninitialized in this function [-Wmaybe-uninitialized]
>     generic_handle_irq(irq);

That's a false positive from GCC. irq is always initialized when
generic_handle_irq() is called.
 
> Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
> ---
>  drivers/dma/ipu/ipu_irq.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/ipu/ipu_irq.c b/drivers/dma/ipu/ipu_irq.c
> index 7489d2a..1a74eee 100644
> --- a/drivers/dma/ipu/ipu_irq.c
> +++ b/drivers/dma/ipu/ipu_irq.c
> @@ -286,23 +286,21 @@ static void ipu_irq_handler(unsigned int __irq, struct irq_desc *desc)
>  		raw_spin_unlock(&bank_lock);
>  		while ((line = ffs(status))) {
>  			struct ipu_irq_map *map;
> -			unsigned int irq;
>  
>  			line--;
>  			status &= ~(1UL << line);
>  
>  			raw_spin_lock(&bank_lock);
>  			map = src2map(32 * i + line);
> -			if (map)
> -				irq = map->irq;
>  			raw_spin_unlock(&bank_lock);
>  
>  			if (!map) {
>  				pr_err("IPU: Interrupt on unmapped source %u bank %d\n",
>  				       line, i);
>  				continue;
> +			} else {
> +				generic_handle_irq(map->irq);

So you change that from retrieving the irq number with bank lock held
to an unprotected access.

Thanks,

	tglx

  reply	other threads:[~2015-08-25  8:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-25  8:01 yalin wang
2015-08-25  8:07 ` Thomas Gleixner [this message]
2015-08-25  8:16   ` yalin wang
2015-08-28  4:33 ` Vinod Koul
2015-08-28  4:34   ` Vinod Koul

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.1508251001560.15006@nanos \
    --to=tglx@linutronix.de \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=jiang.liu@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=vinod.koul@intel.com \
    --cc=yalin.wang2010@gmail.com \
    /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

all inboxes | Powered by JetHome®