Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c0d71f0

Browse files
labbottgregkh
authored andcommitted
staging: android: ion: Break the ABI in the name of forward progress
Several of the Ion ioctls were designed in such a way that they necessitate compat ioctls. We're breaking a bunch of other ABIs and cleaning stuff up anyway so let's follow the ioctl guidelines and clean things up while everyone is busy converting things over anyway. As part of this, also remove the useless alignment field from the allocation structure. Signed-off-by: Laura Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c27dbec commit c0d71f0

File tree

6 files changed

+11
-198
lines changed

6 files changed

+11
-198
lines changed

drivers/staging/android/ion/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@ obj-$(CONFIG_ION) += ion.o ion-ioctl.o ion_heap.o \
22
ion_page_pool.o ion_system_heap.o \
33
ion_carveout_heap.o ion_chunk_heap.o
44
obj-$(CONFIG_ION_CMA_HEAP) += ion_cma_heap.o
5-
ifdef CONFIG_COMPAT
6-
obj-$(CONFIG_ION) += compat_ion.o
7-
endif

drivers/staging/android/ion/compat_ion.c

Lines changed: 0 additions & 152 deletions
This file was deleted.

drivers/staging/android/ion/compat_ion.h

Lines changed: 0 additions & 29 deletions
This file was deleted.

drivers/staging/android/ion/ion-ioctl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#include "ion.h"
2222
#include "ion_priv.h"
23-
#include "compat_ion.h"
2423

2524
union ion_ioctl_arg {
2625
struct ion_fd_data fd;

drivers/staging/android/ion/ion.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040

4141
#include "ion.h"
4242
#include "ion_priv.h"
43-
#include "compat_ion.h"
4443

4544
bool ion_buffer_cached(struct ion_buffer *buffer)
4645
{
@@ -1065,7 +1064,9 @@ static const struct file_operations ion_fops = {
10651064
.open = ion_open,
10661065
.release = ion_release,
10671066
.unlocked_ioctl = ion_ioctl,
1068-
.compat_ioctl = compat_ion_ioctl,
1067+
#ifdef CONFIG_COMPAT
1068+
.compat_ioctl = ion_ioctl,
1069+
#endif
10691070
};
10701071

10711072
static size_t ion_debug_heap_total(struct ion_client *client,

drivers/staging/android/uapi/ion.h

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
#include <linux/ioctl.h>
2121
#include <linux/types.h>
2222

23-
typedef int ion_user_handle_t;
24-
2523
/**
2624
* enum ion_heap_types - list of all possible types of heaps
2725
* @ION_HEAP_TYPE_SYSTEM: memory allocated via vmalloc
@@ -76,7 +74,6 @@ enum ion_heap_type {
7674
/**
7775
* struct ion_allocation_data - metadata passed from userspace for allocations
7876
* @len: size of the allocation
79-
* @align: required alignment of the allocation
8077
* @heap_id_mask: mask of heap ids to allocate from
8178
* @flags: flags passed to heap
8279
* @handle: pointer that will be populated with a cookie to use to
@@ -85,11 +82,11 @@ enum ion_heap_type {
8582
* Provided by userspace as an argument to the ioctl
8683
*/
8784
struct ion_allocation_data {
88-
size_t len;
89-
size_t align;
90-
unsigned int heap_id_mask;
91-
unsigned int flags;
92-
ion_user_handle_t handle;
85+
__u64 len;
86+
__u32 heap_id_mask;
87+
__u32 flags;
88+
__u32 handle;
89+
__u32 unused;
9390
};
9491

9592
/**
@@ -103,16 +100,16 @@ struct ion_allocation_data {
103100
* provides the file descriptor and the kernel returns the handle.
104101
*/
105102
struct ion_fd_data {
106-
ion_user_handle_t handle;
107-
int fd;
103+
__u32 handle;
104+
__u32 fd;
108105
};
109106

110107
/**
111108
* struct ion_handle_data - a handle passed to/from the kernel
112109
* @handle: a handle
113110
*/
114111
struct ion_handle_data {
115-
ion_user_handle_t handle;
112+
__u32 handle;
116113
};
117114

118115
#define MAX_HEAP_NAME 32

0 commit comments

Comments
 (0)