hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/atm/he.c
....@@ -533,9 +533,10 @@
533533
534534 static int he_init_tpdrq(struct he_dev *he_dev)
535535 {
536
- he_dev->tpdrq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
537
- CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq),
538
- &he_dev->tpdrq_phys, GFP_KERNEL);
536
+ he_dev->tpdrq_base = dma_alloc_coherent(&he_dev->pci_dev->dev,
537
+ CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq),
538
+ &he_dev->tpdrq_phys,
539
+ GFP_KERNEL);
539540 if (he_dev->tpdrq_base == NULL) {
540541 hprintk("failed to alloc tpdrq\n");
541542 return -ENOMEM;
....@@ -805,9 +806,9 @@
805806 goto out_free_rbpl_virt;
806807 }
807808
808
- he_dev->rbpl_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
809
- CONFIG_RBPL_SIZE * sizeof(struct he_rbp),
810
- &he_dev->rbpl_phys, GFP_KERNEL);
809
+ he_dev->rbpl_base = dma_alloc_coherent(&he_dev->pci_dev->dev,
810
+ CONFIG_RBPL_SIZE * sizeof(struct he_rbp),
811
+ &he_dev->rbpl_phys, GFP_KERNEL);
811812 if (he_dev->rbpl_base == NULL) {
812813 hprintk("failed to alloc rbpl_base\n");
813814 goto out_destroy_rbpl_pool;
....@@ -844,9 +845,9 @@
844845
845846 /* rx buffer ready queue */
846847
847
- he_dev->rbrq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
848
- CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq),
849
- &he_dev->rbrq_phys, GFP_KERNEL);
848
+ he_dev->rbrq_base = dma_alloc_coherent(&he_dev->pci_dev->dev,
849
+ CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq),
850
+ &he_dev->rbrq_phys, GFP_KERNEL);
850851 if (he_dev->rbrq_base == NULL) {
851852 hprintk("failed to allocate rbrq\n");
852853 goto out_free_rbpl;
....@@ -868,9 +869,9 @@
868869
869870 /* tx buffer ready queue */
870871
871
- he_dev->tbrq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
872
- CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq),
873
- &he_dev->tbrq_phys, GFP_KERNEL);
872
+ he_dev->tbrq_base = dma_alloc_coherent(&he_dev->pci_dev->dev,
873
+ CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq),
874
+ &he_dev->tbrq_phys, GFP_KERNEL);
874875 if (he_dev->tbrq_base == NULL) {
875876 hprintk("failed to allocate tbrq\n");
876877 goto out_free_rbpq_base;
....@@ -913,11 +914,9 @@
913914 /* 2.9.3.5 tail offset for each interrupt queue is located after the
914915 end of the interrupt queue */
915916
916
- he_dev->irq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
917
- (CONFIG_IRQ_SIZE + 1)
918
- * sizeof(struct he_irq),
919
- &he_dev->irq_phys,
920
- GFP_KERNEL);
917
+ he_dev->irq_base = dma_alloc_coherent(&he_dev->pci_dev->dev,
918
+ (CONFIG_IRQ_SIZE + 1) * sizeof(struct he_irq),
919
+ &he_dev->irq_phys, GFP_KERNEL);
921920 if (he_dev->irq_base == NULL) {
922921 hprintk("failed to allocate irq\n");
923922 return -ENOMEM;
....@@ -1464,9 +1463,9 @@
14641463
14651464 /* host status page */
14661465
1467
- he_dev->hsp = dma_zalloc_coherent(&he_dev->pci_dev->dev,
1468
- sizeof(struct he_hsp),
1469
- &he_dev->hsp_phys, GFP_KERNEL);
1466
+ he_dev->hsp = dma_alloc_coherent(&he_dev->pci_dev->dev,
1467
+ sizeof(struct he_hsp),
1468
+ &he_dev->hsp_phys, GFP_KERNEL);
14701469 if (he_dev->hsp == NULL) {
14711470 hprintk("failed to allocate host status page\n");
14721471 return -ENOMEM;
....@@ -1691,7 +1690,7 @@
16911690
16921691 if (RBRQ_HBUF_ERR(he_dev->rbrq_head)) {
16931692 hprintk("HBUF_ERR! (cid 0x%x)\n", cid);
1694
- atomic_inc(&vcc->stats->rx_drop);
1693
+ atomic_inc(&vcc->stats->rx_drop);
16951694 goto return_host_buffers;
16961695 }
16971696
....@@ -1945,14 +1944,14 @@
19451944 switch (type) {
19461945 case ITYPE_RBRQ_THRESH:
19471946 HPRINTK("rbrq%d threshold\n", group);
1948
- /* fall through */
1947
+ fallthrough;
19491948 case ITYPE_RBRQ_TIMER:
19501949 if (he_service_rbrq(he_dev, group))
19511950 he_service_rbpl(he_dev, group);
19521951 break;
19531952 case ITYPE_TBRQ_THRESH:
19541953 HPRINTK("tbrq%d threshold\n", group);
1955
- /* fall through */
1954
+ fallthrough;
19561955 case ITYPE_TPD_COMPLETE:
19571956 he_service_tbrq(he_dev, group);
19581957 break;
....@@ -2581,10 +2580,9 @@
25812580 slot = 0;
25822581 }
25832582
2584
- tpd->iovec[slot].addr = dma_map_single(&he_dev->pci_dev->dev,
2585
- (void *) page_address(frag->page) + frag->page_offset,
2586
- frag->size, DMA_TO_DEVICE);
2587
- tpd->iovec[slot].len = frag->size;
2583
+ tpd->iovec[slot].addr = skb_frag_dma_map(&he_dev->pci_dev->dev,
2584
+ frag, 0, skb_frag_size(frag), DMA_TO_DEVICE);
2585
+ tpd->iovec[slot].len = skb_frag_size(frag);
25882586 ++slot;
25892587
25902588 }