mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] dmaengine: zxdma: fix memset that is currently doing nothing
@ 2015-10-08 17:01 Colin King
  2015-10-09 15:50 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2015-10-08 17:01 UTC (permalink / raw)
  To: Vinod Koul, Dan Williams, dmaengine; +Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The size and value arguments are swapped in the call to memset
effectively making it a no-op because of the zero size.  Swap
these arguments around to do the memset correctly.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/dma/zx296702_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/zx296702_dma.c b/drivers/dma/zx296702_dma.c
index c017fcd..245d759 100644
--- a/drivers/dma/zx296702_dma.c
+++ b/drivers/dma/zx296702_dma.c
@@ -441,7 +441,7 @@ static struct zx_dma_desc_sw *zx_alloc_desc_resource(int num,
 		kfree(ds);
 		return NULL;
 	}
-	memset(ds->desc_hw, sizeof(struct zx_desc_hw) * num, 0);
+	memset(ds->desc_hw, 0, sizeof(struct zx_desc_hw) * num);
 	ds->desc_num = num;
 	return ds;
 }
-- 
2.5.0


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

* Re: [PATCH] dmaengine: zxdma: fix memset that is currently doing nothing
  2015-10-08 17:01 [PATCH] dmaengine: zxdma: fix memset that is currently doing nothing Colin King
@ 2015-10-09 15:50 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2015-10-09 15:50 UTC (permalink / raw)
  To: Colin King; +Cc: Dan Williams, dmaengine, linux-kernel

On Thu, Oct 08, 2015 at 06:01:34PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The size and value arguments are swapped in the call to memset
> effectively making it a no-op because of the zero size.  Swap
> these arguments around to do the memset correctly.

Sorry you are late! You should always sync to target tree before generating
a patch

commit 1a492ac2b87b05c8a175478e79d3c74511c74921
Author: Vinod Koul <vinod.koul@intel.com>
Date:   Thu Oct 1 07:11:48 2015 +0530

    dmaengine: zxdma: fix memset call
    
    Fix the call to memset in this driver
    [linux-4.2-next-20150911/drivers/dma/zx296702_dma.c:444]: (warning)
    memset() called to fill 0 bytes of 'ds'.
    
    Reported-by: David Binderman <dcb314@hotmail.com>
    Signed-off-by: Vinod Koul <vinod.koul@intel.com>

-- 
~Vinod

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

end of thread, other threads:[~2015-10-09 15:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-08 17:01 [PATCH] dmaengine: zxdma: fix memset that is currently doing nothing Colin King
2015-10-09 15:50 ` Vinod Koul

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®