From patchwork Tue Apr 18 18:27:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 9686063 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 486BE601C2 for ; Tue, 18 Apr 2017 18:36:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CF1D2832D for ; Tue, 18 Apr 2017 18:36:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31AC8283E1; Tue, 18 Apr 2017 18:36:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 88C622832D for ; Tue, 18 Apr 2017 18:36:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=M10BJJCH8xveSwhL+QCwrtBXx2IVdrvAjydssDnXpHw=; b=VsB9dJDmcKX/EmFziqJuy7VooQ oJVJy9zp7V/TwzqDjT+mruiZcGEXZgvRSkQSN83KaZE5GNgR6kgQ/JjgJnhu2Gu2CtFYOcEL7SEqO rG0dcJAJL1+Y5lWNC1NZ4j9pZV+3XXRdY4sFIJCR+gEWT/oJpJyRBKyb34SYCyPc945OvMZpSl+r4 PyVx1Ek3nQI/adld/FESA4RlyQMxnFUB2c5FQJqQShfXCzcdYgv11sMaIA+mC8yJ2Z/MUekB0Rf1a HAlSUlNI1t3bp/hS+C6whHeeL09/+WUSwJjOc27t2it5yNhf6W/Jn3fBVBr8lg/9PLXWfzvrDTR7a lXUgSq0g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d0Xza-0006C7-4O; Tue, 18 Apr 2017 18:36:46 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d0XyM-0004qS-Gb for linux-arm-kernel@bombadil.infradead.org; Tue, 18 Apr 2017 18:35:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4Mu9T/p6vETjNXYK4M9M1JW6kBkDjpSpuIW9rX6W7i0=; b=Lf9FQ+8dUKT+AFSJEryUXeSM9 M1OouFUwLHt5dBlteZrK8fgB/jo/OKILnnTlr0gmbiBDESKkvZ05jXl0kSgn9b6VXtdSOZnaJXetT W6uI1jYrpW/ARZpnBqMC3XJPwnSZaojHWo+RUS/FEQUYo8RFW4D+FJ2TiEZranVVOAEsgfmW29M4n uvKzn+LAGkJBce7pzn5c1ItdUafozO0reQM9Qa0JbCn2EOkcK5REE32Yx20kBfiGReYkR/TAAZXAF CvJMZ4QVJ5YLE/olNT4tVW3/i1Qk2ePEDOLgPN9RIETE1q86PovrUV9YOWnmsCvgUHKEjaZM8krqB k274OY0AA==; Received: from mail-qt0-f178.google.com ([209.85.216.178]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d0XyK-0006HJ-Ph for linux-arm-kernel@lists.infradead.org; Tue, 18 Apr 2017 18:35:29 +0000 Received: by mail-qt0-f178.google.com with SMTP id y33so1289655qta.2 for ; Tue, 18 Apr 2017 11:35:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4Mu9T/p6vETjNXYK4M9M1JW6kBkDjpSpuIW9rX6W7i0=; b=n1hTbWX+nrvv+M/b+8h5MXkHncTtM5EadFiPKl2JN5lrc+OWpd9Q2VYWrBWKIE4var KdFIQ1sfrvTQAOAaVc2SSKKVSoPY7f2GTuVK3/4Szv0AeBIzqYdlkYHOOV2/VgCRnBh5 DuIfz1/6gUpfh6RpKn4/++2TIhq4bEsIFf2186cGMvdRGgcs5DtBjLJIxDslVscqqbnm YKFdGjhjKpGma8vue3WzLJKmxzxqivR+AoO9R02ptCNw3Bd5YDut+Uma8KgA5ItQmKGj m6q3WoXoM6pcjbnEG8SEIUtyFRxW9pcL9Nv/CuoIKOVisqgan1SQ5IhgWm6fKs/itR9r KS+w== X-Gm-Message-State: AN3rC/46m1N1Fhy91hseWYYgILGddWxhtqG5LzLngn96efuj30HtdaRj D2YWa9VqU/zf0OyD X-Received: by 10.200.45.60 with SMTP id n57mr16211292qta.15.1492540061096; Tue, 18 Apr 2017 11:27:41 -0700 (PDT) Received: from labbott-redhat-machine.redhat.com ([2601:602:9802:a8dc::159c]) by smtp.gmail.com with ESMTPSA id q66sm10142381qkd.69.2017.04.18.11.27.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Apr 2017 11:27:39 -0700 (PDT) From: Laura Abbott To: Sumit Semwal , Riley Andrews , arve@android.com, Greg Kroah-Hartman Subject: [PATCHv4 06/12] staging: android: ion: Get rid of ion_phys_addr_t Date: Tue, 18 Apr 2017 11:27:08 -0700 Message-Id: <1492540034-5466-7-git-send-email-labbott@redhat.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1492540034-5466-1-git-send-email-labbott@redhat.com> References: <1492540034-5466-1-git-send-email-labbott@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170418_143529_110541_BB2B12E2 X-CRM114-Status: GOOD ( 13.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, romlem@google.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, Mark Brown , Laurent Pinchart , Benjamin Gaignard , Daniel Vetter , Laura Abbott , Brian Starkey , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Once upon a time, phys_addr_t was not everywhere in the kernel. These days it is used enough places that having a separate Ion type doesn't make sense. Remove the extra type and just use phys_addr_t directly. Signed-off-by: Laura Abbott --- drivers/staging/android/ion/ion.h | 12 ++---------- drivers/staging/android/ion/ion_carveout_heap.c | 10 +++++----- drivers/staging/android/ion/ion_chunk_heap.c | 6 +++--- drivers/staging/android/ion/ion_heap.c | 4 ++-- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/drivers/staging/android/ion/ion.h b/drivers/staging/android/ion/ion.h index 3b4bff5..e8a6ffe 100644 --- a/drivers/staging/android/ion/ion.h +++ b/drivers/staging/android/ion/ion.h @@ -28,14 +28,6 @@ struct ion_mapper; struct ion_client; struct ion_buffer; -/* - * This should be removed some day when phys_addr_t's are fully - * plumbed in the kernel, and all instances of ion_phys_addr_t should - * be converted to phys_addr_t. For the time being many kernel interfaces - * do not accept phys_addr_t's that would have to - */ -#define ion_phys_addr_t unsigned long - /** * struct ion_platform_heap - defines a heap in the given platform * @type: type of the heap from ion_heap_type enum @@ -53,9 +45,9 @@ struct ion_platform_heap { enum ion_heap_type type; unsigned int id; const char *name; - ion_phys_addr_t base; + phys_addr_t base; size_t size; - ion_phys_addr_t align; + phys_addr_t align; void *priv; }; diff --git a/drivers/staging/android/ion/ion_carveout_heap.c b/drivers/staging/android/ion/ion_carveout_heap.c index e0e360f..1419a89 100644 --- a/drivers/staging/android/ion/ion_carveout_heap.c +++ b/drivers/staging/android/ion/ion_carveout_heap.c @@ -30,10 +30,10 @@ struct ion_carveout_heap { struct ion_heap heap; struct gen_pool *pool; - ion_phys_addr_t base; + phys_addr_t base; }; -static ion_phys_addr_t ion_carveout_allocate(struct ion_heap *heap, +static phys_addr_t ion_carveout_allocate(struct ion_heap *heap, unsigned long size) { struct ion_carveout_heap *carveout_heap = @@ -46,7 +46,7 @@ static ion_phys_addr_t ion_carveout_allocate(struct ion_heap *heap, return offset; } -static void ion_carveout_free(struct ion_heap *heap, ion_phys_addr_t addr, +static void ion_carveout_free(struct ion_heap *heap, phys_addr_t addr, unsigned long size) { struct ion_carveout_heap *carveout_heap = @@ -63,7 +63,7 @@ static int ion_carveout_heap_allocate(struct ion_heap *heap, unsigned long flags) { struct sg_table *table; - ion_phys_addr_t paddr; + phys_addr_t paddr; int ret; table = kmalloc(sizeof(*table), GFP_KERNEL); @@ -96,7 +96,7 @@ static void ion_carveout_heap_free(struct ion_buffer *buffer) struct ion_heap *heap = buffer->heap; struct sg_table *table = buffer->sg_table; struct page *page = sg_page(table->sgl); - ion_phys_addr_t paddr = PFN_PHYS(page_to_pfn(page)); + phys_addr_t paddr = PFN_PHYS(page_to_pfn(page)); ion_heap_buffer_zero(buffer); diff --git a/drivers/staging/android/ion/ion_chunk_heap.c b/drivers/staging/android/ion/ion_chunk_heap.c index 46e13f6..606f25f 100644 --- a/drivers/staging/android/ion/ion_chunk_heap.c +++ b/drivers/staging/android/ion/ion_chunk_heap.c @@ -27,7 +27,7 @@ struct ion_chunk_heap { struct ion_heap heap; struct gen_pool *pool; - ion_phys_addr_t base; + phys_addr_t base; unsigned long chunk_size; unsigned long size; unsigned long allocated; @@ -151,8 +151,8 @@ struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data) chunk_heap->heap.ops = &chunk_heap_ops; chunk_heap->heap.type = ION_HEAP_TYPE_CHUNK; chunk_heap->heap.flags = ION_HEAP_FLAG_DEFER_FREE; - pr_debug("%s: base %lu size %zu \n", __func__, - chunk_heap->base, heap_data->size); + pr_debug("%s: base %pa size %zu \n", __func__, + &chunk_heap->base, heap_data->size); return &chunk_heap->heap; diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c index 66f8fc5..c974623 100644 --- a/drivers/staging/android/ion/ion_heap.c +++ b/drivers/staging/android/ion/ion_heap.c @@ -345,9 +345,9 @@ struct ion_heap *ion_heap_create(struct ion_platform_heap *heap_data) } if (IS_ERR_OR_NULL(heap)) { - pr_err("%s: error creating heap %s type %d base %lu size %zu\n", + pr_err("%s: error creating heap %s type %d base %pa size %zu\n", __func__, heap_data->name, heap_data->type, - heap_data->base, heap_data->size); + &heap_data->base, heap_data->size); return ERR_PTR(-EINVAL); }