[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <202301171721076625091@zte.com.cn>
Date: Tue, 17 Jan 2023 17:21:07 +0800 (CST)
From: <ye.xingchen@....com.cn>
To: <3chas3@...il.com>
Cc: <linux-atm-general@...ts.sourceforge.net>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH linux-next] atm: lanai: Use dma_zalloc_coherent()
From: ye xingchen <ye.xingchen@....com.cn>
Instead of using dma_alloc_coherent() and memset() directly use
dma_zalloc_coherent().
Signed-off-by: ye xingchen <ye.xingchen@....com.cn>
---
drivers/atm/lanai.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index 32d7aa141d96..b7e0199ce642 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -342,8 +342,8 @@ static void lanai_buf_allocate(struct lanai_buffer *buf,
* everything, but the way the lanai uses DMA memory would
* make that a terrific pain. This is much simpler.
*/
- buf->start = dma_alloc_coherent(&pci->dev,
- size, &buf->dmaaddr, GFP_KERNEL);
+ buf->start = dma_zalloc_coherent(&pci->dev,
+ size, &buf->dmaaddr, GFP_KERNEL);
if (buf->start != NULL) { /* Success */
/* Lanai requires 256-byte alignment of DMA bufs */
APRINTK((buf->dmaaddr & ~0xFFFFFF00) == 0,
@@ -352,7 +352,6 @@ static void lanai_buf_allocate(struct lanai_buffer *buf,
buf->ptr = buf->start;
buf->end = (u32 *)
(&((unsigned char *) buf->start)[size]);
- memset(buf->start, 0, size);
break;
}
size /= 2;
--
2.25.1
Powered by blists - more mailing lists