Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 750afb08 authored by Luis Chamberlain's avatar Luis Chamberlain Committed by Christoph Hellwig
Browse files

cross-tree: phase out dma_zalloc_coherent()



We already need to zero out memory for dma_alloc_coherent(), as such
using dma_zalloc_coherent() is superflous. Phase it out.

This change was generated with the following Coccinelle SmPL patch:

@ replace_dma_zalloc_coherent @
expression dev, size, data, handle, flags;
@@

-dma_zalloc_coherent(dev, size, handle, flags)
+dma_alloc_coherent(dev, size, handle, flags)

Suggested-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
[hch: re-ran the script on the latest tree]
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 3bd6e94b
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -129,7 +129,7 @@ ltq_dma_alloc(struct ltq_dma_channel *ch)
	unsigned long flags;
	unsigned long flags;


	ch->desc = 0;
	ch->desc = 0;
	ch->desc_base = dma_zalloc_coherent(ch->dev,
	ch->desc_base = dma_alloc_coherent(ch->dev,
					   LTQ_DESC_NUM * LTQ_DESC_SIZE,
					   LTQ_DESC_NUM * LTQ_DESC_SIZE,
					   &ch->phys, GFP_ATOMIC);
					   &ch->phys, GFP_ATOMIC);


+1 −1
Original line number Original line Diff line number Diff line
@@ -255,7 +255,7 @@ int pasemi_dma_alloc_ring(struct pasemi_dmachan *chan, int ring_size)


	chan->ring_size = ring_size;
	chan->ring_size = ring_size;


	chan->ring_virt = dma_zalloc_coherent(&dma_pdev->dev,
	chan->ring_virt = dma_alloc_coherent(&dma_pdev->dev,
					     ring_size * sizeof(u64),
					     ring_size * sizeof(u64),
					     &chan->ring_dma, GFP_KERNEL);
					     &chan->ring_dma, GFP_KERNEL);


+4 −3
Original line number Original line Diff line number Diff line
@@ -756,9 +756,10 @@ fsl_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
	}
	}


	/* Initialize outbound message descriptor ring */
	/* Initialize outbound message descriptor ring */
	rmu->msg_tx_ring.virt = dma_zalloc_coherent(priv->dev,
	rmu->msg_tx_ring.virt = dma_alloc_coherent(priv->dev,
						   rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
						   rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
				&rmu->msg_tx_ring.phys, GFP_KERNEL);
						   &rmu->msg_tx_ring.phys,
						   GFP_KERNEL);
	if (!rmu->msg_tx_ring.virt) {
	if (!rmu->msg_tx_ring.virt) {
		rc = -ENOMEM;
		rc = -ENOMEM;
		goto out_dma;
		goto out_dma;
+2 −2
Original line number Original line Diff line number Diff line
@@ -729,7 +729,7 @@ static int sata_fsl_port_start(struct ata_port *ap)
	if (!pp)
	if (!pp)
		return -ENOMEM;
		return -ENOMEM;


	mem = dma_zalloc_coherent(dev, SATA_FSL_PORT_PRIV_DMA_SZ, &mem_dma,
	mem = dma_alloc_coherent(dev, SATA_FSL_PORT_PRIV_DMA_SZ, &mem_dma,
				 GFP_KERNEL);
				 GFP_KERNEL);
	if (!mem) {
	if (!mem) {
		kfree(pp);
		kfree(pp);
+19 −20
Original line number Original line Diff line number Diff line
@@ -533,9 +533,10 @@ static void he_init_tx_lbfp(struct he_dev *he_dev)


static int he_init_tpdrq(struct he_dev *he_dev)
static int he_init_tpdrq(struct he_dev *he_dev)
{
{
	he_dev->tpdrq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
	he_dev->tpdrq_base = dma_alloc_coherent(&he_dev->pci_dev->dev,
						CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq),
						CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq),
						 &he_dev->tpdrq_phys, GFP_KERNEL);
						&he_dev->tpdrq_phys,
						GFP_KERNEL);
	if (he_dev->tpdrq_base == NULL) {
	if (he_dev->tpdrq_base == NULL) {
		hprintk("failed to alloc tpdrq\n");
		hprintk("failed to alloc tpdrq\n");
		return -ENOMEM;
		return -ENOMEM;
@@ -805,7 +806,7 @@ static int he_init_group(struct he_dev *he_dev, int group)
		goto out_free_rbpl_virt;
		goto out_free_rbpl_virt;
	}
	}


	he_dev->rbpl_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
	he_dev->rbpl_base = dma_alloc_coherent(&he_dev->pci_dev->dev,
					       CONFIG_RBPL_SIZE * sizeof(struct he_rbp),
					       CONFIG_RBPL_SIZE * sizeof(struct he_rbp),
					       &he_dev->rbpl_phys, GFP_KERNEL);
					       &he_dev->rbpl_phys, GFP_KERNEL);
	if (he_dev->rbpl_base == NULL) {
	if (he_dev->rbpl_base == NULL) {
@@ -844,7 +845,7 @@ static int he_init_group(struct he_dev *he_dev, int group)


	/* rx buffer ready queue */
	/* rx buffer ready queue */


	he_dev->rbrq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
	he_dev->rbrq_base = dma_alloc_coherent(&he_dev->pci_dev->dev,
					       CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq),
					       CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq),
					       &he_dev->rbrq_phys, GFP_KERNEL);
					       &he_dev->rbrq_phys, GFP_KERNEL);
	if (he_dev->rbrq_base == NULL) {
	if (he_dev->rbrq_base == NULL) {
@@ -868,7 +869,7 @@ static int he_init_group(struct he_dev *he_dev, int group)


	/* tx buffer ready queue */
	/* tx buffer ready queue */


	he_dev->tbrq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
	he_dev->tbrq_base = dma_alloc_coherent(&he_dev->pci_dev->dev,
					       CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq),
					       CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq),
					       &he_dev->tbrq_phys, GFP_KERNEL);
					       &he_dev->tbrq_phys, GFP_KERNEL);
	if (he_dev->tbrq_base == NULL) {
	if (he_dev->tbrq_base == NULL) {
@@ -913,11 +914,9 @@ static int he_init_irq(struct he_dev *he_dev)
	/* 2.9.3.5  tail offset for each interrupt queue is located after the
	/* 2.9.3.5  tail offset for each interrupt queue is located after the
		    end of the interrupt queue */
		    end of the interrupt queue */


	he_dev->irq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
	he_dev->irq_base = dma_alloc_coherent(&he_dev->pci_dev->dev,
					       (CONFIG_IRQ_SIZE + 1)
					      (CONFIG_IRQ_SIZE + 1) * sizeof(struct he_irq),
					       * sizeof(struct he_irq),
					      &he_dev->irq_phys, GFP_KERNEL);
					       &he_dev->irq_phys,
					       GFP_KERNEL);
	if (he_dev->irq_base == NULL) {
	if (he_dev->irq_base == NULL) {
		hprintk("failed to allocate irq\n");
		hprintk("failed to allocate irq\n");
		return -ENOMEM;
		return -ENOMEM;
@@ -1464,7 +1463,7 @@ static int he_start(struct atm_dev *dev)


	/* host status page */
	/* host status page */


	he_dev->hsp = dma_zalloc_coherent(&he_dev->pci_dev->dev,
	he_dev->hsp = dma_alloc_coherent(&he_dev->pci_dev->dev,
					 sizeof(struct he_hsp),
					 sizeof(struct he_hsp),
					 &he_dev->hsp_phys, GFP_KERNEL);
					 &he_dev->hsp_phys, GFP_KERNEL);
	if (he_dev->hsp == NULL) {
	if (he_dev->hsp == NULL) {
Loading