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


Groups > linux.kernel > #1684143 > unrolled thread

[PATCH] [BUGREPORT] media: v4l: omap_vout: vrfb: initialize DMA flags

Started byArnd Bergmann <arnd@arndb.de>
First post2017-07-10 13:20 +0200
Last post2017-07-17 12:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] [BUGREPORT] media: v4l: omap_vout: vrfb: initialize DMA flags Arnd Bergmann <arnd@arndb.de> - 2017-07-10 13:20 +0200
    Re: [PATCH] [BUGREPORT] media: v4l: omap_vout: vrfb: initialize DMA  flags Peter Ujfalusi <peter.ujfalusi@ti.com> - 2017-07-17 12:30 +0200

#1684143 — [PATCH] [BUGREPORT] media: v4l: omap_vout: vrfb: initialize DMA flags

FromArnd Bergmann <arnd@arndb.de>
Date2017-07-10 13:20 +0200
Subject[PATCH] [BUGREPORT] media: v4l: omap_vout: vrfb: initialize DMA flags
Message-ID<u1ETo-4kq-17@gated-at.bofh.it>
Passing uninitialized flags into device_prep_interleaved_dma is clearly
a bad idea, and we get a compiler warning for it:

drivers/media/platform/omap/omap_vout_vrfb.c: In function 'omap_vout_prepare_vrfb':
drivers/media/platform/omap/omap_vout_vrfb.c:273:5: error: 'flags' may be used uninitialized in this function [-Werror=maybe-uninitialized]

It seems that the OMAP dmaengine ignores the flags, but we should
pick the right ones anyway. Unfortunately I don't know what they
should be, so I just picked the most common flags. Please set the
right flags here and fold the modified patch.

Fixes: 6a1560ecaa8c ("media: v4l: omap_vout: vrfb: Convert to dmaengine")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/media/platform/omap/omap_vout_vrfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/omap/omap_vout_vrfb.c b/drivers/media/platform/omap/omap_vout_vrfb.c
index 45a553d4f5b2..fed28b6bbbc0 100644
--- a/drivers/media/platform/omap/omap_vout_vrfb.c
+++ b/drivers/media/platform/omap/omap_vout_vrfb.c
@@ -233,7 +233,7 @@ int omap_vout_prepare_vrfb(struct omap_vout_device *vout,
 			   struct videobuf_buffer *vb)
 {
 	struct dma_async_tx_descriptor *tx;
-	enum dma_ctrl_flags flags;
+	enum dma_ctrl_flags flags = DMA_PREP_INTERRUPT | DMA_CTRL_ACK;
 	struct dma_chan *chan = vout->vrfb_dma_tx.chan;
 	struct dma_device *dmadev = chan->device;
 	struct dma_interleaved_template *xt = vout->vrfb_dma_tx.xt;
-- 
2.9.0

[toc] | [next] | [standalone]


#1688858 — Re: [PATCH] [BUGREPORT] media: v4l: omap_vout: vrfb: initialize DMA flags

FromPeter Ujfalusi <peter.ujfalusi@ti.com>
Date2017-07-17 12:30 +0200
SubjectRe: [PATCH] [BUGREPORT] media: v4l: omap_vout: vrfb: initialize DMA flags
Message-ID<u4brP-3MF-15@gated-at.bofh.it>
In reply to#1684143
Arnd,

sorry for the delayed response, I was away w/o internet connection for
the past weeks.

On 2017-07-10 14:18, Arnd Bergmann wrote:
> Passing uninitialized flags into device_prep_interleaved_dma is clearly
> a bad idea, and we get a compiler warning for it:
> 
> drivers/media/platform/omap/omap_vout_vrfb.c: In function 'omap_vout_prepare_vrfb':
> drivers/media/platform/omap/omap_vout_vrfb.c:273:5: error: 'flags' may be used uninitialized in this function [-Werror=maybe-uninitialized]

I can not explain why I have missed this.

> It seems that the OMAP dmaengine ignores the flags, but we should
> pick the right ones anyway. Unfortunately I don't know what they
> should be, so I just picked the most common flags. Please set the
> right flags here and fold the modified patch.

The flags are fine.

> 
> Fixes: 6a1560ecaa8c ("media: v4l: omap_vout: vrfb: Convert to dmaengine")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> ---
>  drivers/media/platform/omap/omap_vout_vrfb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/omap/omap_vout_vrfb.c b/drivers/media/platform/omap/omap_vout_vrfb.c
> index 45a553d4f5b2..fed28b6bbbc0 100644
> --- a/drivers/media/platform/omap/omap_vout_vrfb.c
> +++ b/drivers/media/platform/omap/omap_vout_vrfb.c
> @@ -233,7 +233,7 @@ int omap_vout_prepare_vrfb(struct omap_vout_device *vout,
>  			   struct videobuf_buffer *vb)
>  {
>  	struct dma_async_tx_descriptor *tx;
> -	enum dma_ctrl_flags flags;
> +	enum dma_ctrl_flags flags = DMA_PREP_INTERRUPT | DMA_CTRL_ACK;
>  	struct dma_chan *chan = vout->vrfb_dma_tx.chan;
>  	struct dma_device *dmadev = chan->device;
>  	struct dma_interleaved_template *xt = vout->vrfb_dma_tx.xt;
> 

- Péter

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web