Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965399AbeAJIBd (ORCPT + 1 other); Wed, 10 Jan 2018 03:01:33 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:33795 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965361AbeAJIB1 (ORCPT ); Wed, 10 Jan 2018 03:01:27 -0500 From: Christoph Hellwig To: iommu@lists.linux-foundation.org Cc: Konrad Rzeszutek Wilk , linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-cris-kernel@axis.com, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-metag@vger.kernel.org, Michal Simek , linux-mips@linux-mips.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, patches@groups.riscv.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, Guan Xuetao , x86@kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/33] microblaze: remove the dead !NOT_COHERENT_CACHE dma code Date: Wed, 10 Jan 2018 09:00:11 +0100 Message-Id: <20180110080027.13879-18-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180110080027.13879-1-hch@lst.de> References: <20180110080027.13879-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Signed-off-by: Christoph Hellwig --- arch/microblaze/kernel/dma.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/arch/microblaze/kernel/dma.c b/arch/microblaze/kernel/dma.c index b45d8f8967af..c91e8cef98dd 100644 --- a/arch/microblaze/kernel/dma.c +++ b/arch/microblaze/kernel/dma.c @@ -15,42 +15,18 @@ #include #include -#define NOT_COHERENT_CACHE - static void *dma_nommu_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag, unsigned long attrs) { -#ifdef NOT_COHERENT_CACHE return consistent_alloc(flag, size, dma_handle); -#else - void *ret; - struct page *page; - int node = dev_to_node(dev); - - /* ignore region specifiers */ - flag &= ~(__GFP_HIGHMEM); - - page = alloc_pages_node(node, flag, get_order(size)); - if (page == NULL) - return NULL; - ret = page_address(page); - memset(ret, 0, size); - *dma_handle = virt_to_phys(ret); - - return ret; -#endif } static void dma_nommu_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle, unsigned long attrs) { -#ifdef NOT_COHERENT_CACHE consistent_free(size, vaddr); -#else - free_pages((unsigned long)vaddr, get_order(size)); -#endif } static inline void __dma_sync(unsigned long paddr, @@ -186,12 +162,8 @@ int dma_nommu_mmap_coherent(struct device *dev, struct vm_area_struct *vma, if (off >= count || user_count > (count - off)) return -ENXIO; -#ifdef NOT_COHERENT_CACHE vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); pfn = consistent_virt_to_pfn(cpu_addr); -#else - pfn = virt_to_pfn(cpu_addr); -#endif return remap_pfn_range(vma, vma->vm_start, pfn + off, vma->vm_end - vma->vm_start, vma->vm_page_prot); #else -- 2.14.2