From 3feae55745a0dbdc503235ff70ad71fd2da9480a Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Sun, 27 Sep 2020 12:50:39 -0400 Subject: [PATCH] scsi: ncr53c8xx: Use slab instead of custom memory allocator There's no need to use __m_calloc for these data structures which aren't shared with the device's processor. Signed-off-by: Matthew Wilcox (Oracle) --- drivers/scsi/ncr53c8xx.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index 03d70138ad58..17edb18da403 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c @@ -373,7 +373,7 @@ static m_addr_t ___dma_getp(m_pool_s *mp) m_addr_t vp; m_vtob_s *vbp; - vbp = __m_calloc(&mp0, sizeof(*vbp), "VTOB"); + vbp = kzalloc(sizeof(*vbp), GFP_ATOMIC); if (vbp) { dma_addr_t daddr; vp = (m_addr_t) dma_alloc_coherent(mp->bush, @@ -390,7 +390,7 @@ static m_addr_t ___dma_getp(m_pool_s *mp) } } if (vbp) - __m_free(&mp0, vbp, sizeof(*vbp), "VTOB"); + kfree(vbp); return 0; } @@ -407,7 +407,7 @@ static void ___dma_freep(m_pool_s *mp, m_addr_t m) *vbpp = (*vbpp)->next; dma_free_coherent(mp->bush, PAGE_SIZE<vaddr, (dma_addr_t)vbp->baddr); - __m_free(&mp0, vbp, sizeof(*vbp), "VTOB"); + kfree(vbp); --mp->nump; } } @@ -422,9 +422,8 @@ static inline m_pool_s *___get_dma_pool(m_bush_t bush) static m_pool_s *___cre_dma_pool(m_bush_t bush) { m_pool_s *mp; - mp = __m_calloc(&mp0, sizeof(*mp), "MPOOL"); + mp = kzalloc(sizeof(*mp), GFP_ATOMIC); if (mp) { - memset(mp, 0, sizeof(*mp)); mp->bush = bush; mp->getp = ___dma_getp; mp->freep = ___dma_freep; @@ -442,7 +441,7 @@ static void ___del_dma_pool(m_pool_s *p) pp = &(*pp)->next; if (*pp) { *pp = (*pp)->next; - __m_free(&mp0, p, sizeof(*p), "MPOOL"); + kfree(p); } } -- 2.50.1