]> www.infradead.org Git - users/willy/linux.git/commitdiff
scsi: sym53c8xx_2: Use slab instead of custom memory allocator
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Sun, 27 Sep 2020 16:50:39 +0000 (12:50 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 28 Sep 2020 13:27:36 +0000 (09:27 -0400)
There's no need to use sym_calloc for these data structures which
aren't shared with the device's processor.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
drivers/scsi/sym53c8xx_2/sym_malloc.c

index eb5c045c7c59f6d2129b8c52730ccf9d841a19ce..8a6b050d0c3bd1d1f36e3662cd343fee682fae9e 100644 (file)
@@ -212,7 +212,7 @@ static void * ___get_dma_mem_cluster(m_pool_p mp)
        m_vtob_p vbp;
        void *vaddr;
 
-       vbp = __sym_calloc(&mp0, sizeof(*vbp), "VTOB");
+       vbp = kzalloc(sizeof(*vbp), GFP_ATOMIC);
        if (!vbp)
                goto out_err;
 
@@ -242,7 +242,7 @@ static void ___free_dma_mem_cluster(m_pool_p mp, void *m)
                vbp = *vbpp;
                *vbpp = (*vbpp)->next;
                sym_m_free_dma_mem_cluster(mp, vbp);
-               __sym_mfree(&mp0, vbp, sizeof(*vbp), "VTOB");
+               kfree(vbp);
                --mp->nump;
        }
 }
@@ -261,7 +261,7 @@ static inline m_pool_p ___get_dma_pool(m_pool_ident_t dev_dmat)
 /* Create a new memory DMAable pool (when fetch failed) */
 static m_pool_p ___cre_dma_pool(m_pool_ident_t dev_dmat)
 {
-       m_pool_p mp = __sym_calloc(&mp0, sizeof(*mp), "MPOOL");
+       m_pool_p mp = kzalloc(sizeof(*mp), GFP_ATOMIC);
        if (mp) {
                mp->dev_dmat = dev_dmat;
                mp->get_mem_cluster = ___get_dma_mem_cluster;
@@ -285,7 +285,7 @@ static void ___del_dma_pool(m_pool_p p)
                pp = &(*pp)->next;
        if (*pp) {
                *pp = (*pp)->next;
-               __sym_mfree(&mp0, p, sizeof(*p), "MPOOL");
+               kfree(p);
        }
 }
 #endif