Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bluetooth: btintel_pcie: Remove unnecessary memset(0) calls

Remove memset(0) after dma_alloc_coherent(), which already zeroes out
the memory, and fix the following two Coccinelle/coccicheck warnings
reported by zalloc-simple.cocci:

btintel_pcie.c:837:19-37: WARNING: dma_alloc_coherent used in

/* Allocate full chunk of data buffer for DMA first and do indexing and
* initialization next, so it can be freed easily
*/
rxq->buf_v_addr already zeroes out memory, so memset is not needed

btintel_pcie.c:792:19-37: WARNING: dma_alloc_coherent used in

/* Allocate full chunk of data buffer for DMA first and do indexing and
* initialization next, so it can be freed easily
*/
txq->buf_v_addr already zeroes out memory, so memset is not needed

Fixes: c2b636b3f788 ("Bluetooth: btintel_pcie: Add support for PCIe transport")
Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

authored by

Thorsten Blum and committed by
Luiz Augusto von Dentz
67c3bcea 973dd9c4

-2
-2
drivers/bluetooth/btintel_pcie.c
··· 797 797 kfree(txq->bufs); 798 798 return -ENOMEM; 799 799 } 800 - memset(txq->buf_v_addr, 0, txq->count * BTINTEL_PCIE_BUFFER_SIZE); 801 800 802 801 /* Setup the allocated DMA buffer to bufs. Each data_buf should 803 802 * have virtual address and physical address ··· 841 842 kfree(rxq->bufs); 842 843 return -ENOMEM; 843 844 } 844 - memset(rxq->buf_v_addr, 0, rxq->count * BTINTEL_PCIE_BUFFER_SIZE); 845 845 846 846 /* Setup the allocated DMA buffer to bufs. Each data_buf should 847 847 * have virtual address and physical address