aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerban Constantinescu <serban.constantinescu@arm.com>2013-01-30 14:20:19 +0000
committerSerban Constantinescu <serban.constantinescu@arm.com>2013-02-04 11:11:06 +0000
commit5dc1b2652d61de48999982f53186dde3fa8e8f14 (patch)
tree3574d3a6eb4ea1551e1506706dacef37145db57e
parent7d1f9aeff1ee4a20b1aeb377dd0f579fe9647619 (diff)
staging: android: ashmem: fix ashmem pin/unpin interface
The values exchanged between kernel and userspace through struct ashmem_pin should be of type size_t. This change won't affect the existing interface but will stand as the basis of 64bit compat layer. Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
-rw-r--r--drivers/staging/android/ashmem.c2
-rw-r--r--drivers/staging/android/ashmem.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index 634b9ae713e0..692eefff4a56 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -605,7 +605,7 @@ static int ashmem_pin_unpin(struct ashmem_area *asma, unsigned long cmd,
if (unlikely((pin.offset | pin.len) & ~PAGE_MASK))
return -EINVAL;
- if (unlikely(((__u32) -1) - pin.offset < pin.len))
+ if (unlikely(((size_t) -1) - pin.offset < pin.len))
return -EINVAL;
if (unlikely(PAGE_ALIGN(asma->size) < pin.offset + pin.len))
diff --git a/drivers/staging/android/ashmem.h b/drivers/staging/android/ashmem.h
index 1976b10ef93e..c9b2ebaa441a 100644
--- a/drivers/staging/android/ashmem.h
+++ b/drivers/staging/android/ashmem.h
@@ -28,8 +28,8 @@
#define ASHMEM_IS_PINNED 1
struct ashmem_pin {
- __u32 offset; /* offset into region, in bytes, page-aligned */
- __u32 len; /* length forward from offset, in bytes, page-aligned */
+ size_t offset; /* offset into region, in bytes, page-aligned */
+ size_t len; /* length forward from offset, in bytes, page-aligned */
};
#define __ASHMEMIOC 0x77