Skip to contentSkip to conversation

drivers/iwlwifi: use dma_zalloc_coherent() for DMA allocation

PATCH In review Djalal Harouni 4 participants 4 messages Dec 21, 2011 – Dec 22, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/iwlwifi: use dma_zalloc_coherent() for DMA allocation

Replace dma_alloc_coherent()+memset() with the new dma_zalloc_coherent()

---
 drivers/net/wireless/iwlwifi/iwl-trans-pcie.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +4 -6
index ce91898..4363da7 100644
@@ -88,18 +88,16 @@ static int iwl_trans_rx_alloc(struct iwl_trans *trans)
 		return -EINVAL;
 
 	/* Allocate the circular buffer of Read Buffer Descriptors (RBDs) */
-	rxq->bd = dma_alloc_coherent(dev, sizeof(__le32) * RX_QUEUE_SIZE,
-				     &rxq->bd_dma, GFP_KERNEL);
+	rxq->bd = dma_zalloc_coherent(dev, sizeof(__le32) * RX_QUEUE_SIZE,
+				      &rxq->bd_dma, GFP_KERNEL);
 	if (!rxq->bd)
 		goto err_bd;
-	memset(rxq->bd, 0, sizeof(__le32) * RX_QUEUE_SIZE);
 
 	/*Allocate the driver's pointer to receive buffer status */
-	rxq->rb_stts = dma_alloc_coherent(dev, sizeof(*rxq->rb_stts),
-					  &rxq->rb_stts_dma, GFP_KERNEL);
+	rxq->rb_stts = dma_zalloc_coherent(dev, sizeof(*rxq->rb_stts),
+					   &rxq->rb_stts_dma, GFP_KERNEL);
 	if (!rxq->rb_stts)
 		goto err_rb_stts;
-	memset(rxq->rb_stts, 0, sizeof(*rxq->rb_stts));
 
 	return 0;
 
Signature · 1 line
1.7.1
#1 lore raw

Hi Djalal,

Quoted 4 lines · Djalal Harouni

Replace dma_alloc_coherent()+memset() with the new dma_zalloc_coherent()

---

iwl-trans-pcie.c is one of the source files in iwlwifi driver hold dual-license (GPL + BSD), are you ok to release your code for the BSD license and relinquish the copyright?

btw, we are in the process of rewrite and re-architect major portion of iwlwifi driver, and we also plan to make most of the code dual-license (GPL + BSD).

Thanks you in advance

Wey

#2 lore raw
Quoted 4 lines · Wey-Yi

Hi Djalal,

On Tue, 2011-12-20 at 16:21 -0800, Djalal Harouni wrote:

Quoted 8 lines
Quoted 4 lines

Replace dma_alloc_coherent()+memset() with the new dma_zalloc_coherent()

---

iwl-trans-pcie.c is one of the source files in iwlwifi driver hold dual-license (GPL + BSD), are you ok to release your code for the BSD license and relinquish the copyright?

Yes, It's ok.

Quoted 7 lines

btw, we are in the process of rewrite and re-architect major portion of iwlwifi driver, and we also plan to make most of the code dual-license (GPL + BSD).

Thanks you in advance

Wey

Thanks Wey.

Signature · 2 lines
tixxdz
http://opendz.org
#3 lore raw

Hi Djalal,

Quoted 4 lines

iwl-trans-pcie.c is one of the source files in iwlwifi driver hold dual-license (GPL + BSD), are you ok to release your code for the BSD license and relinquish the copyright?

Yes, It's ok.

Thank you very much

Wey
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html