Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1212790 > unrolled thread

Re: [PATCH] dma/ipu: change ipu_irq_handler() to remove compile warning

Started byThomas Gleixner <tglx@linutronix.de>
First post2015-08-25 10:20 +0200
Last post2015-08-25 10:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] dma/ipu: change ipu_irq_handler() to remove compile  warning Thomas Gleixner <tglx@linutronix.de> - 2015-08-25 10:20 +0200
    Re: [PATCH] dma/ipu: change ipu_irq_handler() to remove compile warning yalin wang <yalin.wang2010@gmail.com> - 2015-08-25 10:20 +0200

#1212790 — Re: [PATCH] dma/ipu: change ipu_irq_handler() to remove compile warning

FromThomas Gleixner <tglx@linutronix.de>
Date2015-08-25 10:20 +0200
SubjectRe: [PATCH] dma/ipu: change ipu_irq_handler() to remove compile warning
Message-ID<q1hCx-P0-15@gated-at.bofh.it>
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1212791 — Re: [PATCH] dma/ipu: change ipu_irq_handler() to remove compile warning

Fromyalin wang <yalin.wang2010@gmail.com>
Date2015-08-25 10:20 +0200
SubjectRe: [PATCH] dma/ipu: change ipu_irq_handler() to remove compile warning
Message-ID<q1hCy-P0-21@gated-at.bofh.it>
In reply to#1212790
> On Aug 25, 2015, at 16:07, Thomas Gleixner <tglx@linutronix.de> wrote:
> 
> 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.

i see,
i will send a V2 patch .

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web