From 9b7c080b29445eed9c5afb7442ab6362e7a91f9a Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Sun, 27 Sep 2020 12:50:39 -0400 Subject: [PATCH] scsi: ncr53c8xx: Remove mp0 memory pool Now we don't use the mp0 pool, we can remove it. Signed-off-by: Matthew Wilcox (Oracle) --- drivers/scsi/ncr53c8xx.c | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index 17edb18da403..454495c2cfe3 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c @@ -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; -- 2.50.1