|
@@ -26,11 +26,9 @@
|
|
|
#include "ion.h"
|
|
|
#include "ion_priv.h"
|
|
|
|
|
|
-static unsigned int high_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO |
|
|
|
- __GFP_NOWARN | __GFP_NORETRY) &
|
|
|
- ~__GFP_WAIT;
|
|
|
-static unsigned int low_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO |
|
|
|
- __GFP_NOWARN);
|
|
|
+static gfp_t high_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN |
|
|
|
+ __GFP_NORETRY) & ~__GFP_WAIT;
|
|
|
+static gfp_t low_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN);
|
|
|
static const unsigned int orders[] = {8, 4, 0};
|
|
|
static const int num_orders = ARRAY_SIZE(orders);
|
|
|
static int order_to_index(unsigned int order)
|
|
@@ -76,12 +74,12 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap,
|
|
|
gfp_flags = high_order_gfp_flags;
|
|
|
page = alloc_pages(gfp_flags, order);
|
|
|
if (!page)
|
|
|
- return 0;
|
|
|
+ return NULL;
|
|
|
ion_pages_sync_for_device(NULL, page, PAGE_SIZE << order,
|
|
|
DMA_BIDIRECTIONAL);
|
|
|
}
|
|
|
if (!page)
|
|
|
- return 0;
|
|
|
+ return NULL;
|
|
|
|
|
|
return page;
|
|
|
}
|
|
@@ -187,7 +185,7 @@ err:
|
|
|
return -ENOMEM;
|
|
|
}
|
|
|
|
|
|
-void ion_system_heap_free(struct ion_buffer *buffer)
|
|
|
+static void ion_system_heap_free(struct ion_buffer *buffer)
|
|
|
{
|
|
|
struct ion_heap *heap = buffer->heap;
|
|
|
struct ion_system_heap *sys_heap = container_of(heap,
|
|
@@ -211,14 +209,14 @@ void ion_system_heap_free(struct ion_buffer *buffer)
|
|
|
kfree(table);
|
|
|
}
|
|
|
|
|
|
-struct sg_table *ion_system_heap_map_dma(struct ion_heap *heap,
|
|
|
- struct ion_buffer *buffer)
|
|
|
+static struct sg_table *ion_system_heap_map_dma(struct ion_heap *heap,
|
|
|
+ struct ion_buffer *buffer)
|
|
|
{
|
|
|
return buffer->priv_virt;
|
|
|
}
|
|
|
|
|
|
-void ion_system_heap_unmap_dma(struct ion_heap *heap,
|
|
|
- struct ion_buffer *buffer)
|
|
|
+static void ion_system_heap_unmap_dma(struct ion_heap *heap,
|
|
|
+ struct ion_buffer *buffer)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
@@ -403,7 +401,7 @@ out:
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-void ion_system_contig_heap_free(struct ion_buffer *buffer)
|
|
|
+static void ion_system_contig_heap_free(struct ion_buffer *buffer)
|
|
|
{
|
|
|
struct sg_table *table = buffer->priv_virt;
|
|
|
struct page *page = sg_page(table->sgl);
|
|
@@ -427,14 +425,14 @@ static int ion_system_contig_heap_phys(struct ion_heap *heap,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-struct sg_table *ion_system_contig_heap_map_dma(struct ion_heap *heap,
|
|
|
+static struct sg_table *ion_system_contig_heap_map_dma(struct ion_heap *heap,
|
|
|
struct ion_buffer *buffer)
|
|
|
{
|
|
|
return buffer->priv_virt;
|
|
|
}
|
|
|
|
|
|
-void ion_system_contig_heap_unmap_dma(struct ion_heap *heap,
|
|
|
- struct ion_buffer *buffer)
|
|
|
+static void ion_system_contig_heap_unmap_dma(struct ion_heap *heap,
|
|
|
+ struct ion_buffer *buffer)
|
|
|
{
|
|
|
}
|
|
|
|