Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: android: binder: replace types with portable ones

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Serban Constantinescu and committed by
Greg Kroah-Hartman
eecddef5 ec35e852

+13 -13
+13 -13
drivers/staging/android/binder.h
··· 123 123 void *ptr; /* target descriptor of return transaction */ 124 124 } target; 125 125 void *cookie; /* target object cookie */ 126 - unsigned int code; /* transaction command */ 126 + __u32 code; /* transaction command */ 127 127 128 128 /* General information about the transaction. */ 129 - unsigned int flags; 129 + __u32 flags; 130 130 pid_t sender_pid; 131 131 uid_t sender_euid; 132 132 size_t data_size; /* number of bytes of data */ ··· 143 143 /* offsets from buffer to flat_binder_object structs */ 144 144 const void __user *offsets; 145 145 } ptr; 146 - uint8_t buf[8]; 146 + __u8 buf[8]; 147 147 } data; 148 148 }; 149 149 ··· 153 153 }; 154 154 155 155 struct binder_pri_desc { 156 - int priority; 157 - int desc; 156 + __s32 priority; 157 + __s32 desc; 158 158 }; 159 159 160 160 struct binder_pri_ptr_cookie { 161 - int priority; 161 + __s32 priority; 162 162 void *ptr; 163 163 void *cookie; 164 164 }; 165 165 166 166 enum binder_driver_return_protocol { 167 - BR_ERROR = _IOR('r', 0, int), 167 + BR_ERROR = _IOR('r', 0, __s32), 168 168 /* 169 169 * int: error code 170 170 */ ··· 178 178 * binder_transaction_data: the received command. 179 179 */ 180 180 181 - BR_ACQUIRE_RESULT = _IOR('r', 4, int), 181 + BR_ACQUIRE_RESULT = _IOR('r', 4, __s32), 182 182 /* 183 183 * not currently supported 184 184 * int: 0 if the last bcATTEMPT_ACQUIRE was not successful. ··· 258 258 * binder_transaction_data: the sent command. 259 259 */ 260 260 261 - BC_ACQUIRE_RESULT = _IOW('c', 2, int), 261 + BC_ACQUIRE_RESULT = _IOW('c', 2, __s32), 262 262 /* 263 263 * not currently supported 264 264 * int: 0 if the last BR_ATTEMPT_ACQUIRE was not successful. ··· 270 270 * void *: ptr to transaction data received on a read 271 271 */ 272 272 273 - BC_INCREFS = _IOW('c', 4, int), 274 - BC_ACQUIRE = _IOW('c', 5, int), 275 - BC_RELEASE = _IOW('c', 6, int), 276 - BC_DECREFS = _IOW('c', 7, int), 273 + BC_INCREFS = _IOW('c', 4, __u32), 274 + BC_ACQUIRE = _IOW('c', 5, __u32), 275 + BC_RELEASE = _IOW('c', 6, __u32), 276 + BC_DECREFS = _IOW('c', 7, __u32), 277 277 /* 278 278 * int: descriptor 279 279 */