]> www.infradead.org Git - users/willy/linux.git/commitdiff
scsi: ncr53c8xx: Remove mp0 memory pool
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)
Now we don't use the mp0 pool, we can remove it.

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

index 17edb18da40317d8392fa792170ceeed057c59b5..454495c2cfe3ef0e83488f2b9394515f43ef5acd 100644 (file)
@@ -186,7 +186,6 @@ static inline struct list_head *ncr_list_pop(struct list_head *head)
 #endif
 #define MEMO_FREE_UNUSED       /* Free unused pages immediately */
 #define MEMO_WARN      1
-#define MEMO_GFP_FLAGS GFP_ATOMIC
 #define MEMO_CLUSTER_SHIFT     (PAGE_SHIFT+MEMO_PAGE_ORDER)
 #define MEMO_CLUSTER_SIZE      (1UL << MEMO_CLUSTER_SHIFT)
 #define MEMO_CLUSTER_MASK      (MEMO_CLUSTER_SIZE-1)
@@ -338,27 +337,7 @@ static void __m_free(m_pool_s *mp, void *ptr, int size, char *name)
 
 }
 
-/*
- * With pci bus iommu support, we use a default pool of unmapped memory 
- * for memory we donnot need to DMA from/to and one pool per pcidev for 
- * memory accessed by the PCI chip. `mp0' is the default not DMAable pool.
- */
-
-static m_addr_t ___mp0_getp(m_pool_s *mp)
-{
-       m_addr_t m = __get_free_pages(MEMO_GFP_FLAGS, MEMO_PAGE_ORDER);
-       if (m)
-               ++mp->nump;
-       return m;
-}
-
-static void ___mp0_freep(m_pool_s *mp, m_addr_t m)
-{
-       free_pages(m, MEMO_PAGE_ORDER);
-       --mp->nump;
-}
-
-static m_pool_s mp0 = {NULL, ___mp0_getp, ___mp0_freep};
+static m_pool_s *mempools;
 
 /*
  * DMAable pools.
@@ -415,7 +394,7 @@ static void ___dma_freep(m_pool_s *mp, m_addr_t m)
 static inline m_pool_s *___get_dma_pool(m_bush_t bush)
 {
        m_pool_s *mp;
-       for (mp = mp0.next; mp && mp->bush != bush; mp = mp->next);
+       for (mp = mempools; mp && mp->bush != bush; mp = mp->next);
        return mp;
 }
 
@@ -427,15 +406,15 @@ static m_pool_s *___cre_dma_pool(m_bush_t bush)
                mp->bush = bush;
                mp->getp = ___dma_getp;
                mp->freep = ___dma_freep;
-               mp->next = mp0.next;
-               mp0.next = mp;
+               mp->next = mempools;
+               mempools = mp;
        }
        return mp;
 }
 
 static void ___del_dma_pool(m_pool_s *p)
 {
-       struct m_pool **pp = &mp0.next;
+       struct m_pool **pp = &mempools;
 
        while (*pp && *pp != p)
                pp = &(*pp)->next;