aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/android/ion/ion_heap.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2013-11-12 15:28:08 -0800
committerColin Cross <ccross@android.com>2013-11-15 16:11:11 -0800
commitc1d3cea1d0b985a78a87675a07c2dab865a416f1 (patch)
treeffc00931985d2ac9280e7cfa983574ab21f401c7 /drivers/staging/android/ion/ion_heap.c
parent51e3580bf9da57da9c860330293b73b0dbb296e0 (diff)
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. Change-Id: Id9b07f1196b2bafe04636fa1aa46dfc84d003cf0 Signed-off-by: Colin Cross <ccross@android.com>
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 9be246f50a0..f32f4e69765 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;