linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] Fix warning during compilation
@ 2017-01-03  8:23 ivan.stoyanov
  2017-01-03 21:57 ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: ivan.stoyanov @ 2017-01-03  8:23 UTC (permalink / raw)
  To: vinod.koul; +Cc: arnd, dan.j.williams, dmaengine, linux-kernel, amk

From: amk <amk@amk-drives.bg>

drivers/dma/ipu/ipu_irq.c: In function 'ipu_irq_fn':
drivers/dma/ipu/ipu_irq.c:342:4: warning: 'irq' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: amk <amk@amk-drives.bg>
---
 drivers/dma/ipu/ipu_irq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/ipu/ipu_irq.c b/drivers/dma/ipu/ipu_irq.c
index 3f9477c..fae6ef8a 100644
--- a/drivers/dma/ipu/ipu_irq.c
+++ b/drivers/dma/ipu/ipu_irq.c
@@ -330,15 +330,15 @@ static void ipu_irq_fn(struct irq_desc *desc)
 
 			raw_spin_lock(&bank_lock);
 			map = src2map(32 * i + line);
-			if (map)
-				irq = map->irq;
-			raw_spin_unlock(&bank_lock);
 
 			if (!map) {
+				raw_spin_unlock(&bank_lock);
 				pr_err("IPU: Interrupt on unmapped source %u bank %d\n",
 				       line, i);
 				continue;
 			}
+			irq = map->irq;
+			raw_spin_unlock(&bank_lock);
 			generic_handle_irq(irq);
 		}
 	}
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] Fix warning during compilation
  2017-01-03  8:23 [PATCH 2/2] Fix warning during compilation ivan.stoyanov
@ 2017-01-03 21:57 ` Arnd Bergmann
  2017-01-04  6:36   ` Ivan Stoyanov
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2017-01-03 21:57 UTC (permalink / raw)
  To: ivan.stoyanov; +Cc: vinod.koul, dan.j.williams, dmaengine, linux-kernel, amk

On Tuesday, January 3, 2017 10:23:29 AM CET ivan.stoyanov@amk-drives.bg wrote:
> From: amk <amk@amk-drives.bg>
> 
> drivers/dma/ipu/ipu_irq.c: In function 'ipu_irq_fn':
> drivers/dma/ipu/ipu_irq.c:342:4: warning: 'irq' may be used uninitialized in this function [-Wmaybe-uninitialized]
> 
> Signed-off-by: amk <amk@amk-drives.bg>
> ---

This looks like my patch 86c7e6836479 ("dmaengine: ipu: remove bogus NO_IRQ reference")
that was applied in September, but it seems to be written for an older kernel
prior to v4.3.

Which kernel version were you testing on?

	Arnd

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] Fix warning during compilation
  2017-01-03 21:57 ` Arnd Bergmann
@ 2017-01-04  6:36   ` Ivan Stoyanov
  0 siblings, 0 replies; 3+ messages in thread
From: Ivan Stoyanov @ 2017-01-04  6:36 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: vinod.koul, dan.j.williams, dmaengine, linux-kernel, amk

I have done this patch for mainline because since v4.3 the ipu driver 
doesn't work properly.
The reason is mistake in v4.3 considering both functions ipu_irq_err and 
ipu_irq_fn for equal and they was merged to ipu_irq_handler.
But there is only one difference between these functions which was missed.

In ipu_irq_err:
for (i = IPU_IRQ_NR_FN_BANKS; i < IPU_IRQ_NR_BANKS; i++) {

In ipu_irq_fn:
for (i = 0; i < IPU_IRQ_NR_FN_BANKS; i++) {

All kernel versions since v4.3 make kernel to freeze on boot.

Kind regards,
Ivan

On 3.1.2017 г. 23:57 ч., Arnd Bergmann wrote:
> On Tuesday, January 3, 2017 10:23:29 AM CET ivan.stoyanov@amk-drives.bg wrote:
>> From: amk <amk@amk-drives.bg>
>>
>> drivers/dma/ipu/ipu_irq.c: In function 'ipu_irq_fn':
>> drivers/dma/ipu/ipu_irq.c:342:4: warning: 'irq' may be used uninitialized in this function [-Wmaybe-uninitialized]
>>
>> Signed-off-by: amk <amk@amk-drives.bg>
>> ---
> This looks like my patch 86c7e6836479 ("dmaengine: ipu: remove bogus NO_IRQ reference")
> that was applied in September, but it seems to be written for an older kernel
> prior to v4.3.
>
> Which kernel version were you testing on?
>
> 	Arnd

-- 
Best regards,

Ivan Stoyanov

AMK "Drives and Controls" Ltd.
Bulgaria
5300 Gabrovo
1 "Gen. Nikolov" str.
www.amk-drives.bg

Phone:  +359 / 66 / 819136
E-mail: ivan.stoyanov@amk-drives.bg

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-04  6:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-03  8:23 [PATCH 2/2] Fix warning during compilation ivan.stoyanov
2017-01-03 21:57 ` Arnd Bergmann
2017-01-04  6:36   ` Ivan Stoyanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).