From patchwork Fri Dec 13 22:24:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22441 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EC7F423FBA for ; Fri, 13 Dec 2013 22:28:11 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wm4sf8747177obc.7 for ; Fri, 13 Dec 2013 14:28:11 -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=toEXzNnyph1JrW4hvoA1J7cq5HfG7E6xrfAYEtnsk8A=; b=ZUJSj8TpQDtcl/U7yTVF/7fqCMob09k0hxG/os0k5i2Me2p6yvwQgLdEl4tdzhZ2j2 /fQ4WGNRXV2qy/kWFEiUjutbYLjcHjqTbL9g0KA4WOvl4MRAj/mBbFsKWyqk+JyZz4qz weBS830ooswjmgZ6dLSym9xQFqv+ELD/Do2NfF++6wZTSEBO+CdWgqyHKlE1hTQhrqOy FAdIJv+8DJrTrm5QApDH3B7zVRpnrayv+2V7oanA4XXTSm7oLulVDf3GS3NWGYijO+m3 PZTieJsuNDJNZ2YAHJgP+PpcKQZEg036XFyQD1FfeakgGfdBeM7juxbhNWQeYP3/heaw tIvQ== X-Gm-Message-State: ALoCoQmWSmqn7nCsF3PM8EVe7E+If6renskhIGvaFjWLcdxivcvAO2IDArNEVJWTUeDs7mRnyswA X-Received: by 10.182.104.200 with SMTP id gg8mr1739757obb.45.1386973691561; Fri, 13 Dec 2013 14:28:11 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.4.138 with SMTP id k10ls1157065qek.13.gmail; Fri, 13 Dec 2013 14:28:11 -0800 (PST) X-Received: by 10.58.145.200 with SMTP id sw8mr1425296veb.68.1386973691458; Fri, 13 Dec 2013 14:28:11 -0800 (PST) Received: from mail-vb0-f48.google.com (mail-vb0-f48.google.com [209.85.212.48]) by mx.google.com with ESMTPS id ef6si1200972ved.47.2013.12.13.14.28.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:28:11 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.48 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.48; Received: by mail-vb0-f48.google.com with SMTP id f13so1723521vbg.35 for ; Fri, 13 Dec 2013 14:28:11 -0800 (PST) X-Received: by 10.221.54.65 with SMTP id vt1mr2234865vcb.46.1386973691331; Fri, 13 Dec 2013 14:28:11 -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 u4csp73604vcz; Fri, 13 Dec 2013 14:28:10 -0800 (PST) X-Received: by 10.67.14.67 with SMTP id fe3mr6005812pad.134.1386973690558; Fri, 13 Dec 2013 14:28:10 -0800 (PST) Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by mx.google.com with ESMTPS id tt8si2528467pbc.18.2013.12.13.14.28.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:28:10 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.48 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.48; Received: by mail-pb0-f48.google.com with SMTP id md12so3137664pbc.21 for ; Fri, 13 Dec 2013 14:28:10 -0800 (PST) X-Received: by 10.66.149.73 with SMTP id ty9mr6174333pab.36.1386973690019; Fri, 13 Dec 2013 14:28:10 -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.08 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:28:09 -0800 (PST) From: John Stultz To: LKML Cc: Greg KH , Android Kernel Team , Sumit Semwal , Jesse Barker , Colin Cross , Rom Lemarchand , John Stultz Subject: [PATCH 079/115] ion: add new ion_user_handle_t type for the user-space token Date: Fri, 13 Dec 2013 14:24:53 -0800 Message-Id: <1386973529-4884-80-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.212.48 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: Rom Lemarchand Declare new ion_user_handle_t type to contain the token returned to user-space. This allows a 2-step migration of the user-space code to a new kernel header first, then will allow us to change the definition of the ion_user_handle_type_t to int without breaking the API. Signed-off-by: Rom Lemarchand (cherry picked from commit ebb8269bbb05b06ecedca3e21b3e65f23d48eadd) [jstultz: modified patch to apply to staging directory] Signed-off-by: John Stultz --- drivers/staging/android/ion/ion.c | 4 ++-- drivers/staging/android/ion/ion.h | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 273ec3a..e2a3033 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -1139,7 +1139,7 @@ static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) if (IS_ERR(handle)) return PTR_ERR(handle); - data.handle = (struct ion_handle *)handle->id; + data.handle = (ion_user_handle_t)handle->id; if (copy_to_user((void __user *)arg, &data, sizeof(data))) { ion_free(client, handle); @@ -1191,7 +1191,7 @@ static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) if (IS_ERR(handle)) ret = PTR_ERR(handle); else - data.handle = (struct ion_handle *)handle->id; + data.handle = (ion_user_handle_t)handle->id; if (copy_to_user((void __user *)arg, &data, sizeof(struct ion_fd_data))) diff --git a/drivers/staging/android/ion/ion.h b/drivers/staging/android/ion/ion.h index 3942b3e..244f085 100644 --- a/drivers/staging/android/ion/ion.h +++ b/drivers/staging/android/ion/ion.h @@ -20,6 +20,8 @@ #include struct ion_handle; +typedef struct ion_handle *ion_user_handle_t; + /** * enum ion_heap_types - list of all possible types of heaps * @ION_HEAP_TYPE_SYSTEM: memory allocated via vmalloc @@ -268,7 +270,7 @@ struct ion_allocation_data { size_t align; unsigned int heap_id_mask; unsigned int flags; - struct ion_handle *handle; + ion_user_handle_t handle; }; /** @@ -282,7 +284,7 @@ struct ion_allocation_data { * provides the file descriptor and the kernel returns the handle. */ struct ion_fd_data { - struct ion_handle *handle; + ion_user_handle_t handle; int fd; }; @@ -291,7 +293,7 @@ struct ion_fd_data { * @handle: a handle */ struct ion_handle_data { - struct ion_handle *handle; + ion_user_handle_t handle; }; /**