From patchwork Fri Dec 13 22:25:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22454 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0ED9D23FF5 for ; Fri, 13 Dec 2013 22:28:29 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wo20sf8775858obc.9 for ; Fri, 13 Dec 2013 14:28:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=BK/St+8agKa/MQI1ZbOntKrTT/37jw8klKMTDdDtRy8=; b=a2+7rtR7Xi0ii/NZFWC3tUeIvGgdxnrU2tpYXIIQ5Snz0UPvlvA0edsmgK0jQYdHVm 837j0nTrHaX7HfoS+Uh7I8LgA+lhUtsqg4+3TkUw/dr8yMoAOPE4/cijQ388DaKhzVlE +ltlIqsad6TWt4judip783FApOeeoU25jLdlU4SAicg4Ei0n63cwQPQfVsUFGq1RBI8+ X5OF3G+p5aRB6f1H9rNgrv281AR3N04jxoX+ViXsFh2xg9fBHlgvkkMI3Mw5jWBUrwFB 5uHo8VnV39Tnnn5QSYaC6O6yWWSC8QkVFEIQmn6mopDbnyiKFL21HO7R9R8kP31Jc1Fe sIDg== X-Gm-Message-State: ALoCoQky4HRu/id3KRNZgUxVE/NlwDtyW0vs6PXC52nfgpVFUTUSbQ3rCQa50t4Pj8Pk6MJ7vxDf X-Received: by 10.42.196.68 with SMTP id ef4mr1730124icb.18.1386973708684; Fri, 13 Dec 2013 14:28:28 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.60.37 with SMTP id e5ls1243866qer.84.gmail; Fri, 13 Dec 2013 14:28:28 -0800 (PST) X-Received: by 10.224.94.8 with SMTP id x8mr9112436qam.1.1386973708274; Fri, 13 Dec 2013 14:28:28 -0800 (PST) Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) by mx.google.com with ESMTPS id h17si3685538qej.117.2013.12.13.14.28.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:28:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.216.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.216.47; Received: by mail-qa0-f47.google.com with SMTP id w5so1222046qac.6 for ; Fri, 13 Dec 2013 14:28:28 -0800 (PST) X-Received: by 10.224.162.212 with SMTP id w20mr9015754qax.68.1386973706909; Fri, 13 Dec 2013 14:28:26 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp73637vcz; Fri, 13 Dec 2013 14:28:26 -0800 (PST) X-Received: by 10.68.240.36 with SMTP id vx4mr6107422pbc.140.1386973706086; Fri, 13 Dec 2013 14:28:26 -0800 (PST) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx.google.com with ESMTPS id cz3si2480182pbc.333.2013.12.13.14.28.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:28:26 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.54 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.54; Received: by mail-pb0-f54.google.com with SMTP id un15so3165265pbc.27 for ; Fri, 13 Dec 2013 14:28:25 -0800 (PST) X-Received: by 10.66.146.199 with SMTP id te7mr6067220pab.106.1386973705587; Fri, 13 Dec 2013 14:28:25 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id qz9sm7457908pbc.3.2013.12.13.14.28.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:28:24 -0800 (PST) From: John Stultz To: LKML Cc: Greg KH , Android Kernel Team , Sumit Semwal , Jesse Barker , Colin Cross , John Stultz Subject: [PATCH 088/115] ion: convert sg_dma_len(sg) to sg->length Date: Fri, 13 Dec 2013 14:25:02 -0800 Message-Id: <1386973529-4884-89-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> References: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.216.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Colin Cross 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 Signed-off-by: John Stultz --- drivers/staging/android/ion/ion.c | 2 +- drivers/staging/android/ion/ion_chunk_heap.c | 4 ++-- drivers/staging/android/ion/ion_heap.c | 12 ++++++------ drivers/staging/android/ion/ion_system_heap.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 4bdbdec..8d568ca 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -224,7 +224,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, for_each_sg(table->sgl, sg, table->nents, i) { struct page *page = sg_page(sg); - for (j = 0; j < sg_dma_len(sg) / PAGE_SIZE; j++) + for (j = 0; j < sg->length / PAGE_SIZE; j++) buffer->pages[k++] = page++; } diff --git a/drivers/staging/android/ion/ion_chunk_heap.c b/drivers/staging/android/ion/ion_chunk_heap.c index 2fddc04..62f7439 100644 --- a/drivers/staging/android/ion/ion_chunk_heap.c +++ b/drivers/staging/android/ion/ion_chunk_heap.c @@ -84,7 +84,7 @@ err: sg = table->sgl; for (i -= 1; i >= 0; i--) { gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)), - sg_dma_len(sg)); + sg->length); sg = sg_next(sg); } sg_free_table(table); @@ -112,7 +112,7 @@ static void ion_chunk_heap_free(struct ion_buffer *buffer) for_each_sg(table->sgl, sg, table->nents, i) { gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)), - sg_dma_len(sg)); + sg->length); } chunk_heap->allocated -= allocated_size; sg_free_table(table); 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; diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index 792cade..967eedc 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -209,7 +209,7 @@ void ion_system_heap_free(struct ion_buffer *buffer) for_each_sg(table->sgl, sg, table->nents, i) free_buffer_page(sys_heap, buffer, sg_page(sg), - get_order(sg_dma_len(sg))); + get_order(sg->length)); sg_free_table(table); kfree(table); }