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


Groups > linux.kernel > #1549592 > unrolled thread

[PATCH 2/2] Fix warning during compilation

Started byivan.stoyanov@amk-drives.bg
First post2017-01-03 09:30 +0100
Last post2017-01-04 07:40 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 2/2] Fix warning during compilation ivan.stoyanov@amk-drives.bg - 2017-01-03 09:30 +0100
    Re: [PATCH 2/2] Fix warning during compilation Arnd Bergmann <arnd@arndb.de> - 2017-01-03 23:00 +0100
      Re: [PATCH 2/2] Fix warning during compilation Ivan Stoyanov <ivan.stoyanov@amk-drives.bg> - 2017-01-04 07:40 +0100

#1549592 — [PATCH 2/2] Fix warning during compilation

Fromivan.stoyanov@amk-drives.bg
Date2017-01-03 09:30 +0100
Subject[PATCH 2/2] Fix warning during compilation
Message-ID<sVsDM-3nL-7@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1550244

FromArnd Bergmann <arnd@arndb.de>
Date2017-01-03 23:00 +0100
Message-ID<sVFhE-3PT-25@gated-at.bofh.it>
In reply to#1549592
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

[toc] | [prev] | [next] | [standalone]


#1550465

FromIvan Stoyanov <ivan.stoyanov@amk-drives.bg>
Date2017-01-04 07:40 +0100
Message-ID<sVNoR-RY-17@gated-at.bofh.it>
In reply to#1550244
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web