summaryrefslogtreecommitdiffstats
path: root/drivers/staging/android/ion/ion_heap.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2013-12-13 14:25:02 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-14 08:57:18 -0800
commit06e0dcaeb4fd72a010a1f5ad0c03abd8e0a58ef9 (patch)
treeef4a050814ec6bc09a77c1d532bf572b37660ddd /drivers/staging/android/ion/ion_heap.c
parente946b209c2ed15b1f7917def8fe6602747c3f771 (diff)
downloadop-kernel-dev-06e0dcaeb4fd72a010a1f5ad0c03abd8e0a58ef9.zip
op-kernel-dev-06e0dcaeb4fd72a010a1f5ad0c03abd8e0a58ef9.tar.gz
ion: convert sg_dma_len(sg) to sg->length
ion is always dealing with the allocation and not the mapping, so it should always be using sg->length and not sg->dma_length. Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android/ion/ion_heap.c')
-rw-r--r--drivers/staging/android/ion/ion_heap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c
index a584ec0..a5a7c572 100644
--- a/drivers/staging/android/ion/ion_heap.c
+++ b/drivers/staging/android/ion/ion_heap.c
@@ -46,7 +46,7 @@ void *ion_heap_map_kernel(struct ion_heap *heap,
pgprot = pgprot_writecombine(PAGE_KERNEL);
for_each_sg(table->sgl, sg, table->nents, i) {
- int npages_this_entry = PAGE_ALIGN(sg_dma_len(sg)) / PAGE_SIZE;
+ int npages_this_entry = PAGE_ALIGN(sg->length) / PAGE_SIZE;
struct page *page = sg_page(sg);
BUG_ON(i >= npages);
for (j = 0; j < npages_this_entry; j++) {
@@ -80,14 +80,14 @@ int ion_heap_map_user(struct ion_heap *heap, struct ion_buffer *buffer,
for_each_sg(table->sgl, sg, table->nents, i) {
struct page *page = sg_page(sg);
unsigned long remainder = vma->vm_end - addr;
- unsigned long len = sg_dma_len(sg);
+ unsigned long len = sg->length;
- if (offset >= sg_dma_len(sg)) {
- offset -= sg_dma_len(sg);
+ if (offset >= sg->length) {
+ offset -= sg->length;
continue;
} else if (offset) {
page += offset / PAGE_SIZE;
- len = sg_dma_len(sg) - offset;
+ len = sg->length - offset;
offset = 0;
}
len = min(len, remainder);
@@ -119,7 +119,7 @@ int ion_heap_buffer_zero(struct ion_buffer *buffer)
for_each_sg(table->sgl, sg, table->nents, i) {
struct page *page = sg_page(sg);
- unsigned long len = sg_dma_len(sg);
+ unsigned long len = sg->length;
for (j = 0; j < len / PAGE_SIZE; j++) {
struct page *sub_page = page + j;
OpenPOWER on IntegriCloud