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.

rapidio/tsi721: switch to dma_zalloc_coherent

Replace the pair dma_alloc_coherent()+memset() with the new
dma_zalloc_coherent() added by Andrew Morton for kernel version 3.2

Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Alexandre Bounine and committed by
Linus Torvalds
ceb96398 2a95ea6c

+4 -13
+4 -13
drivers/rapidio/devices/tsi721.c
··· 851 851 INIT_WORK(&priv->idb_work, tsi721_db_dpc); 852 852 853 853 /* Allocate buffer for inbound doorbells queue */ 854 - priv->idb_base = dma_alloc_coherent(&priv->pdev->dev, 854 + priv->idb_base = dma_zalloc_coherent(&priv->pdev->dev, 855 855 IDB_QSIZE * TSI721_IDB_ENTRY_SIZE, 856 856 &priv->idb_dma, GFP_KERNEL); 857 857 if (!priv->idb_base) 858 858 return -ENOMEM; 859 - 860 - memset(priv->idb_base, 0, IDB_QSIZE * TSI721_IDB_ENTRY_SIZE); 861 859 862 860 dev_dbg(&priv->pdev->dev, "Allocated IDB buffer @ %p (phys = %llx)\n", 863 861 priv->idb_base, (unsigned long long)priv->idb_dma); ··· 902 904 */ 903 905 904 906 /* Allocate space for DMA descriptors */ 905 - bd_ptr = dma_alloc_coherent(&priv->pdev->dev, 907 + bd_ptr = dma_zalloc_coherent(&priv->pdev->dev, 906 908 bd_num * sizeof(struct tsi721_dma_desc), 907 909 &bd_phys, GFP_KERNEL); 908 910 if (!bd_ptr) ··· 911 913 priv->bdma[chnum].bd_phys = bd_phys; 912 914 priv->bdma[chnum].bd_base = bd_ptr; 913 915 914 - memset(bd_ptr, 0, bd_num * sizeof(struct tsi721_dma_desc)); 915 - 916 916 dev_dbg(&priv->pdev->dev, "DMA descriptors @ %p (phys = %llx)\n", 917 917 bd_ptr, (unsigned long long)bd_phys); 918 918 ··· 918 922 sts_size = (bd_num >= TSI721_DMA_MINSTSSZ) ? 919 923 bd_num : TSI721_DMA_MINSTSSZ; 920 924 sts_size = roundup_pow_of_two(sts_size); 921 - sts_ptr = dma_alloc_coherent(&priv->pdev->dev, 925 + sts_ptr = dma_zalloc_coherent(&priv->pdev->dev, 922 926 sts_size * sizeof(struct tsi721_dma_sts), 923 927 &sts_phys, GFP_KERNEL); 924 928 if (!sts_ptr) { ··· 933 937 priv->bdma[chnum].sts_phys = sts_phys; 934 938 priv->bdma[chnum].sts_base = sts_ptr; 935 939 priv->bdma[chnum].sts_size = sts_size; 936 - 937 - memset(sts_ptr, 0, sts_size); 938 940 939 941 dev_dbg(&priv->pdev->dev, 940 942 "desc status FIFO @ %p (phys = %llx) size=0x%x\n", ··· 1394 1400 1395 1401 /* Outbound message descriptor status FIFO allocation */ 1396 1402 priv->omsg_ring[mbox].sts_size = roundup_pow_of_two(entries + 1); 1397 - priv->omsg_ring[mbox].sts_base = dma_alloc_coherent(&priv->pdev->dev, 1403 + priv->omsg_ring[mbox].sts_base = dma_zalloc_coherent(&priv->pdev->dev, 1398 1404 priv->omsg_ring[mbox].sts_size * 1399 1405 sizeof(struct tsi721_dma_sts), 1400 1406 &priv->omsg_ring[mbox].sts_phys, GFP_KERNEL); ··· 1405 1411 rc = -ENOMEM; 1406 1412 goto out_desc; 1407 1413 } 1408 - 1409 - memset(priv->omsg_ring[mbox].sts_base, 0, 1410 - entries * sizeof(struct tsi721_dma_sts)); 1411 1414 1412 1415 /* 1413 1416 * Configure Outbound Messaging Engine