* [PATCH] arm64: hide unused swiotlb functions
@ 2018-11-02 15:26 Arnd Bergmann
2018-11-02 17:49 ` Catalin Marinas
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-11-02 15:26 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon
Cc: Christoph Hellwig, Arnd Bergmann, Robin Murphy, Marek Szyprowski,
linux-arm-kernel, linux-kernel
After a good chunk of the swiotlb code has been replaced with the generic
version, two functions are only used from inside of an #ifdef:
arch/arm64/mm/dma-mapping.c:174:12: error: '__swiotlb_mmap_pfn' defined but not used [-Werror=unused-function]
static int __swiotlb_mmap_pfn(struct vm_area_struct *vma,
^~~~~~~~~~~~~~~~~~
arch/arm64/mm/dma-mapping.c:163:12: error: '__swiotlb_get_sgtable_page' defined but not used [-Werror=unused-function]
static int __swiotlb_get_sgtable_page(struct sg_table *sgt,
Move them into the same #ifdef section to avoid that warning.
Fixes: 886643b76632 ("arm64: use the generic swiotlb_dma_ops")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm64/mm/dma-mapping.c | 58 ++++++++++++++++++-------------------
1 file changed, 29 insertions(+), 29 deletions(-)
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index 3a703e5d4e32..62356c64e180 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -160,35 +160,6 @@ void arch_sync_dma_for_cpu(struct device *dev, phys_addr_t paddr,
__dma_unmap_area(phys_to_virt(paddr), size, dir);
}
-static int __swiotlb_get_sgtable_page(struct sg_table *sgt,
- struct page *page, size_t size)
-{
- int ret = sg_alloc_table(sgt, 1, GFP_KERNEL);
-
- if (!ret)
- sg_set_page(sgt->sgl, page, PAGE_ALIGN(size), 0);
-
- return ret;
-}
-
-static int __swiotlb_mmap_pfn(struct vm_area_struct *vma,
- unsigned long pfn, size_t size)
-{
- int ret = -ENXIO;
- unsigned long nr_vma_pages = vma_pages(vma);
- unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT;
- unsigned long off = vma->vm_pgoff;
-
- if (off < nr_pages && nr_vma_pages <= (nr_pages - off)) {
- ret = remap_pfn_range(vma, vma->vm_start,
- pfn + off,
- vma->vm_end - vma->vm_start,
- vma->vm_page_prot);
- }
-
- return ret;
-}
-
static int __init atomic_pool_init(void)
{
pgprot_t prot = __pgprot(PROT_NORMAL_NC);
@@ -358,6 +329,35 @@ arch_initcall(arm64_dma_init);
#include <linux/platform_device.h>
#include <linux/amba/bus.h>
+static int __swiotlb_get_sgtable_page(struct sg_table *sgt,
+ struct page *page, size_t size)
+{
+ int ret = sg_alloc_table(sgt, 1, GFP_KERNEL);
+
+ if (!ret)
+ sg_set_page(sgt->sgl, page, PAGE_ALIGN(size), 0);
+
+ return ret;
+}
+
+static int __swiotlb_mmap_pfn(struct vm_area_struct *vma,
+ unsigned long pfn, size_t size)
+{
+ int ret = -ENXIO;
+ unsigned long nr_vma_pages = vma_pages(vma);
+ unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT;
+ unsigned long off = vma->vm_pgoff;
+
+ if (off < nr_pages && nr_vma_pages <= (nr_pages - off)) {
+ ret = remap_pfn_range(vma, vma->vm_start,
+ pfn + off,
+ vma->vm_end - vma->vm_start,
+ vma->vm_page_prot);
+ }
+
+ return ret;
+}
+
/* Thankfully, all cache ops are by VA so we can ignore phys here */
static void flush_page(struct device *dev, const void *virt, phys_addr_t phys)
{
--
2.18.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] arm64: hide unused swiotlb functions
2018-11-02 15:26 [PATCH] arm64: hide unused swiotlb functions Arnd Bergmann
@ 2018-11-02 17:49 ` Catalin Marinas
0 siblings, 0 replies; 2+ messages in thread
From: Catalin Marinas @ 2018-11-02 17:49 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Will Deacon, linux-kernel, Robin Murphy, Christoph Hellwig,
linux-arm-kernel, Marek Szyprowski
On Fri, Nov 02, 2018 at 04:26:07PM +0100, Arnd Bergmann wrote:
> After a good chunk of the swiotlb code has been replaced with the generic
> version, two functions are only used from inside of an #ifdef:
>
> arch/arm64/mm/dma-mapping.c:174:12: error: '__swiotlb_mmap_pfn' defined but not used [-Werror=unused-function]
> static int __swiotlb_mmap_pfn(struct vm_area_struct *vma,
> ^~~~~~~~~~~~~~~~~~
> arch/arm64/mm/dma-mapping.c:163:12: error: '__swiotlb_get_sgtable_page' defined but not used [-Werror=unused-function]
> static int __swiotlb_get_sgtable_page(struct sg_table *sgt,
>
> Move them into the same #ifdef section to avoid that warning.
>
> Fixes: 886643b76632 ("arm64: use the generic swiotlb_dma_ops")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Christoph already proposed a fix here:
https://marc.info/?l=linux-arm-kernel&m=154091441602535
--
Catalin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-02 17:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-02 15:26 [PATCH] arm64: hide unused swiotlb functions Arnd Bergmann
2018-11-02 17:49 ` Catalin Marinas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®