فهرست منبع

rt2x00: Use dma_zalloc_coherent

Use the zeroing function instead of dma_alloc_coherent & memset(,0,)

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Joe Perches 11 سال پیش
والد
کامیت
df6e633323
1فایلهای تغییر یافته به همراه3 افزوده شده و 5 حذف شده
  1. 3 5
      drivers/net/wireless/rt2x00/rt2x00mmio.c

+ 3 - 5
drivers/net/wireless/rt2x00/rt2x00mmio.c

@@ -119,14 +119,12 @@ static int rt2x00mmio_alloc_queue_dma(struct rt2x00_dev *rt2x00dev,
 	/*
 	/*
 	 * Allocate DMA memory for descriptor and buffer.
 	 * Allocate DMA memory for descriptor and buffer.
 	 */
 	 */
-	addr = dma_alloc_coherent(rt2x00dev->dev,
-				  queue->limit * queue->desc_size,
-				  &dma, GFP_KERNEL);
+	addr = dma_zalloc_coherent(rt2x00dev->dev,
+				   queue->limit * queue->desc_size, &dma,
+				   GFP_KERNEL);
 	if (!addr)
 	if (!addr)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
-	memset(addr, 0, queue->limit * queue->desc_size);
-
 	/*
 	/*
 	 * Initialize all queue entries to contain valid addresses.
 	 * Initialize all queue entries to contain valid addresses.
 	 */
 	 */