From: Serban Constantinescu <Serban.Constantinescu@arm.com>
To: "Arve Hjønnevåg" <arve@android.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Greg KH <gregkh@linuxfoundation.org>,
Android Kernel Team <kernel-team@android.com>,
John Stultz <john.stultz@linaro.org>,
Dave Butcher <Dave.Butcher@arm.com>
Subject: Re: [PATCH v5 5/6] staging: android: binder: replace types with portable ones
Date: Thu, 04 Jul 2013 10:39:13 +0100 [thread overview]
Message-ID: <51D542C1.6060808@arm.com> (raw)
In-Reply-To: <CAMP5XgcgvSGezR5ZnoLik2r+ztFogxtPGNRzwHJtrK+zycCocw@mail.gmail.com>
On 03/07/13 23:30, Arve Hjønnevåg wrote:
> On Wed, Jun 19, 2013 at 10:12 AM, Serban Constantinescu
> <serban.constantinescu@arm.com> wrote:
>> Since this driver is meant to be used on different types of processors
>> and a portable driver should specify the size a variable expects to be
>> this patch changes the types used throughout the binder interface.
>>
>> We use "userspace" types since this header will be exported and used by
>> the Android filesystem.
>>
>> The patch does not change in any way the functionality of the binder driver.
>>
>> Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
>> Acked-by: Arve Hjønnevåg <arve@android.com>
>> ---
>> drivers/staging/android/binder.h | 26 +++++++++++++-------------
>> 1 file changed, 13 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/staging/android/binder.h b/drivers/staging/android/binder.h
>> index b55bba9..dadfce0 100644
>> --- a/drivers/staging/android/binder.h
>> +++ b/drivers/staging/android/binder.h
>> @@ -123,10 +123,10 @@ struct binder_transaction_data {
>> void *ptr; /* target descriptor of return transaction */
>> } target;
>> void *cookie; /* target object cookie */
>> - unsigned int code; /* transaction command */
>> + __u32 code; /* transaction command */
>>
>> /* General information about the transaction. */
>> - unsigned int flags;
>> + __u32 flags;
>> pid_t sender_pid;
>> uid_t sender_euid;
>> size_t data_size; /* number of bytes of data */
>> @@ -143,7 +143,7 @@ struct binder_transaction_data {
>> /* offsets from buffer to flat_binder_object structs */
>> const void __user *offsets;
>> } ptr;
>> - uint8_t buf[8];
>> + __u8 buf[8];
>> } data;
>> };
>>
>> @@ -153,18 +153,18 @@ struct binder_ptr_cookie {
>> };
>>
>> struct binder_pri_desc {
>> - int priority;
>> - int desc;
>> + __s32 priority;
>> + __s32 desc;
>
> desc should be __u32 to be consistent with the other changes you are
> making in this and the next patch.
I have added this change to v6 of this patch set which I will send out
shortly.
Thanks again for your feedback,
Serban
>
>> };
>>
>> struct binder_pri_ptr_cookie {
>> - int priority;
>> + __s32 priority;
>> void *ptr;
>> void *cookie;
>> };
>>
>> enum binder_driver_return_protocol {
>> - BR_ERROR = _IOR('r', 0, int),
>> + BR_ERROR = _IOR('r', 0, __s32),
>> /*
>> * int: error code
>> */
>> @@ -178,7 +178,7 @@ enum binder_driver_return_protocol {
>> * binder_transaction_data: the received command.
>> */
>>
>> - BR_ACQUIRE_RESULT = _IOR('r', 4, int),
>> + BR_ACQUIRE_RESULT = _IOR('r', 4, __s32),
>> /*
>> * not currently supported
>> * int: 0 if the last bcATTEMPT_ACQUIRE was not successful.
>> @@ -258,7 +258,7 @@ enum binder_driver_command_protocol {
>> * binder_transaction_data: the sent command.
>> */
>>
>> - BC_ACQUIRE_RESULT = _IOW('c', 2, int),
>> + BC_ACQUIRE_RESULT = _IOW('c', 2, __s32),
>> /*
>> * not currently supported
>> * int: 0 if the last BR_ATTEMPT_ACQUIRE was not successful.
>> @@ -270,10 +270,10 @@ enum binder_driver_command_protocol {
>> * void *: ptr to transaction data received on a read
>> */
>>
>> - BC_INCREFS = _IOW('c', 4, int),
>> - BC_ACQUIRE = _IOW('c', 5, int),
>> - BC_RELEASE = _IOW('c', 6, int),
>> - BC_DECREFS = _IOW('c', 7, int),
>> + BC_INCREFS = _IOW('c', 4, __u32),
>> + BC_ACQUIRE = _IOW('c', 5, __u32),
>> + BC_RELEASE = _IOW('c', 6, __u32),
>> + BC_DECREFS = _IOW('c', 7, __u32),
>> /*
>> * int: descriptor
>> */
>> --
>> 1.7.9.5
>>
>
>
>
> --
> Arve Hjønnevåg
>
next prev parent reply other threads:[~2013-07-04 9:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-19 17:12 [PATCH v5 0/6] Android Binder IPC Fixes Serban Constantinescu
2013-06-19 17:12 ` [PATCH v5 1/6] staging: android: binder: modify struct binder_write_read to use size_t Serban Constantinescu
2013-06-19 17:12 ` [PATCH v5 2/6] staging: android: binder: fix BINDER_SET_MAX_THREADS declaration Serban Constantinescu
2013-06-19 17:12 ` [PATCH v5 3/6] staging: android: binder: fix BC_FREE_BUFFER ioctl declaration Serban Constantinescu
2013-06-19 17:12 ` [PATCH v5 4/6] staging: android: binder: fix alignment issues Serban Constantinescu
2013-07-03 22:29 ` Arve Hjønnevåg
2013-06-19 17:12 ` [PATCH v5 5/6] staging: android: binder: replace types with portable ones Serban Constantinescu
2013-07-03 22:30 ` Arve Hjønnevåg
2013-07-04 9:39 ` Serban Constantinescu [this message]
2013-06-19 17:12 ` [PATCH v5 6/6] staging: android: binder: fix binder interface for 64bit compat layer Serban Constantinescu
2013-07-03 22:30 ` Arve Hjønnevåg
2013-07-03 16:35 ` [PATCH v5 0/6] Android Binder IPC Fixes Serban Constantinescu
2013-07-03 22:32 ` Arve Hjønnevåg
2013-07-04 9:49 ` Serban Constantinescu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51D542C1.6060808@arm.com \
--to=serban.constantinescu@arm.com \
--cc=Dave.Butcher@arm.com \
--cc=arve@android.com \
--cc=gregkh@linuxfoundation.org \
--cc=john.stultz@linaro.org \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox