diff options
author | Luis Chamberlain <mcgrof@kernel.org> | 2019-01-04 03:23:09 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2019-01-08 07:58:37 -0500 |
commit | 750afb08ca71310fcf0c4e2cb1565c63b8235b60 (patch) | |
tree | 1dde3877eb4a1a0f0349786b66c3d9276ae94561 /drivers/atm | |
parent | 3bd6e94bec122a951d462c239b47954cf5f36e33 (diff) |
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: Christoph Hellwig <hch@lst.de>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
[hch: re-ran the script on the latest tree]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/atm')
-rw-r--r-- | drivers/atm/he.c | 39 | ||||
-rw-r--r-- | drivers/atm/idt77252.c | 16 |
2 files changed, 27 insertions, 28 deletions
diff --git a/drivers/atm/he.c b/drivers/atm/he.c index 29f102dcfec4..2e9d1cfe3aeb 100644 --- a/drivers/atm/he.c +++ b/drivers/atm/he.c | |||
@@ -533,9 +533,10 @@ static void he_init_tx_lbfp(struct he_dev *he_dev) | |||
533 | 533 | ||
534 | static int he_init_tpdrq(struct he_dev *he_dev) | 534 | static int he_init_tpdrq(struct he_dev *he_dev) |
535 | { | 535 | { |
536 | he_dev->tpdrq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev, | 536 | he_dev->tpdrq_base = dma_alloc_coherent(&he_dev->pci_dev->dev, |
537 | CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq), | 537 | CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq), |
538 | &he_dev->tpdrq_phys, GFP_KERNEL); | 538 | &he_dev->tpdrq_phys, |
539 | GFP_KERNEL); | ||
539 | if (he_dev->tpdrq_base == NULL) { | 540 | if (he_dev->tpdrq_base == NULL) { |
540 | hprintk("failed to alloc tpdrq\n"); | 541 | hprintk("failed to alloc tpdrq\n"); |
541 | return -ENOMEM; | 542 | return -ENOMEM; |
@@ -805,9 +806,9 @@ static int he_init_group(struct he_dev *he_dev, int group) | |||
805 | goto out_free_rbpl_virt; | 806 | goto out_free_rbpl_virt; |
806 | } | 807 | } |
807 | 808 | ||
808 | he_dev->rbpl_base = dma_zalloc_coherent(&he_dev->pci_dev->dev, | 809 | he_dev->rbpl_base = dma_alloc_coherent(&he_dev->pci_dev->dev, |
809 | CONFIG_RBPL_SIZE * sizeof(struct he_rbp), | 810 | CONFIG_RBPL_SIZE * sizeof(struct he_rbp), |
810 | &he_dev->rbpl_phys, GFP_KERNEL); | 811 | &he_dev->rbpl_phys, GFP_KERNEL); |
811 | if (he_dev->rbpl_base == NULL) { | 812 | if (he_dev->rbpl_base == NULL) { |
812 | hprintk("failed to alloc rbpl_base\n"); | 813 | hprintk("failed to alloc rbpl_base\n"); |
813 | goto out_destroy_rbpl_pool; | 814 | goto out_destroy_rbpl_pool; |
@@ -844,9 +845,9 @@ static int he_init_group(struct he_dev *he_dev, int group) | |||
844 | 845 | ||
845 | /* rx buffer ready queue */ | 846 | /* rx buffer ready queue */ |
846 | 847 | ||
847 | he_dev->rbrq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev, | 848 | he_dev->rbrq_base = dma_alloc_coherent(&he_dev->pci_dev->dev, |
848 | CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq), | 849 | CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq), |
849 | &he_dev->rbrq_phys, GFP_KERNEL); | 850 | &he_dev->rbrq_phys, GFP_KERNEL); |
850 | if (he_dev->rbrq_base == NULL) { | 851 | if (he_dev->rbrq_base == NULL) { |
851 | hprintk("failed to allocate rbrq\n"); | 852 | hprintk("failed to allocate rbrq\n"); |
852 | goto out_free_rbpl; | 853 | goto out_free_rbpl; |
@@ -868,9 +869,9 @@ static int he_init_group(struct he_dev *he_dev, int group) | |||
868 | 869 | ||
869 | /* tx buffer ready queue */ | 870 | /* tx buffer ready queue */ |
870 | 871 | ||
871 | he_dev->tbrq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev, | 872 | he_dev->tbrq_base = dma_alloc_coherent(&he_dev->pci_dev->dev, |
872 | CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq), | 873 | CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq), |
873 | &he_dev->tbrq_phys, GFP_KERNEL); | 874 | &he_dev->tbrq_phys, GFP_KERNEL); |
874 | if (he_dev->tbrq_base == NULL) { | 875 | if (he_dev->tbrq_base == NULL) { |
875 | hprintk("failed to allocate tbrq\n"); | 876 | hprintk("failed to allocate tbrq\n"); |
876 | goto out_free_rbpq_base; | 877 | goto out_free_rbpq_base; |
@@ -913,11 +914,9 @@ static int he_init_irq(struct he_dev *he_dev) | |||
913 | /* 2.9.3.5 tail offset for each interrupt queue is located after the | 914 | /* 2.9.3.5 tail offset for each interrupt queue is located after the |
914 | end of the interrupt queue */ | 915 | end of the interrupt queue */ |
915 | 916 | ||
916 | he_dev->irq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev, | 917 | he_dev->irq_base = dma_alloc_coherent(&he_dev->pci_dev->dev, |
917 | (CONFIG_IRQ_SIZE + 1) | 918 | (CONFIG_IRQ_SIZE + 1) * sizeof(struct he_irq), |
918 | * sizeof(struct he_irq), | 919 | &he_dev->irq_phys, GFP_KERNEL); |
919 | &he_dev->irq_phys, | ||
920 | GFP_KERNEL); | ||
921 | if (he_dev->irq_base == NULL) { | 920 | if (he_dev->irq_base == NULL) { |
922 | hprintk("failed to allocate irq\n"); | 921 | hprintk("failed to allocate irq\n"); |
923 | return -ENOMEM; | 922 | return -ENOMEM; |
@@ -1464,9 +1463,9 @@ static int he_start(struct atm_dev *dev) | |||
1464 | 1463 | ||
1465 | /* host status page */ | 1464 | /* host status page */ |
1466 | 1465 | ||
1467 | he_dev->hsp = dma_zalloc_coherent(&he_dev->pci_dev->dev, | 1466 | he_dev->hsp = dma_alloc_coherent(&he_dev->pci_dev->dev, |
1468 | sizeof(struct he_hsp), | 1467 | sizeof(struct he_hsp), |
1469 | &he_dev->hsp_phys, GFP_KERNEL); | 1468 | &he_dev->hsp_phys, GFP_KERNEL); |
1470 | if (he_dev->hsp == NULL) { | 1469 | if (he_dev->hsp == NULL) { |
1471 | hprintk("failed to allocate host status page\n"); | 1470 | hprintk("failed to allocate host status page\n"); |
1472 | return -ENOMEM; | 1471 | return -ENOMEM; |
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index 6e737142ceaa..43a14579e80e 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c | |||
@@ -641,8 +641,8 @@ alloc_scq(struct idt77252_dev *card, int class) | |||
641 | scq = kzalloc(sizeof(struct scq_info), GFP_KERNEL); | 641 | scq = kzalloc(sizeof(struct scq_info), GFP_KERNEL); |
642 | if (!scq) | 642 | if (!scq) |
643 | return NULL; | 643 | return NULL; |
644 | scq->base = dma_zalloc_coherent(&card->pcidev->dev, SCQ_SIZE, | 644 | scq->base = dma_alloc_coherent(&card->pcidev->dev, SCQ_SIZE, |
645 | &scq->paddr, GFP_KERNEL); | 645 | &scq->paddr, GFP_KERNEL); |
646 | if (scq->base == NULL) { | 646 | if (scq->base == NULL) { |
647 | kfree(scq); | 647 | kfree(scq); |
648 | return NULL; | 648 | return NULL; |
@@ -971,8 +971,8 @@ init_rsq(struct idt77252_dev *card) | |||
971 | { | 971 | { |
972 | struct rsq_entry *rsqe; | 972 | struct rsq_entry *rsqe; |
973 | 973 | ||
974 | card->rsq.base = dma_zalloc_coherent(&card->pcidev->dev, RSQSIZE, | 974 | card->rsq.base = dma_alloc_coherent(&card->pcidev->dev, RSQSIZE, |
975 | &card->rsq.paddr, GFP_KERNEL); | 975 | &card->rsq.paddr, GFP_KERNEL); |
976 | if (card->rsq.base == NULL) { | 976 | if (card->rsq.base == NULL) { |
977 | printk("%s: can't allocate RSQ.\n", card->name); | 977 | printk("%s: can't allocate RSQ.\n", card->name); |
978 | return -1; | 978 | return -1; |
@@ -3390,10 +3390,10 @@ static int init_card(struct atm_dev *dev) | |||
3390 | writel(0, SAR_REG_GP); | 3390 | writel(0, SAR_REG_GP); |
3391 | 3391 | ||
3392 | /* Initialize RAW Cell Handle Register */ | 3392 | /* Initialize RAW Cell Handle Register */ |
3393 | card->raw_cell_hnd = dma_zalloc_coherent(&card->pcidev->dev, | 3393 | card->raw_cell_hnd = dma_alloc_coherent(&card->pcidev->dev, |
3394 | 2 * sizeof(u32), | 3394 | 2 * sizeof(u32), |
3395 | &card->raw_cell_paddr, | 3395 | &card->raw_cell_paddr, |
3396 | GFP_KERNEL); | 3396 | GFP_KERNEL); |
3397 | if (!card->raw_cell_hnd) { | 3397 | if (!card->raw_cell_hnd) { |
3398 | printk("%s: memory allocation failure.\n", card->name); | 3398 | printk("%s: memory allocation failure.\n", card->name); |
3399 | deinit_card(card); | 3399 | deinit_card(card); |