From: Serban Constantinescu <serban.constantinescu@arm.com>
To: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
kernel-team@android.com, arve@android.com,
john.stultz@linaro.org, Dave.Butcher@arm.com
Cc: Serban Constantinescu <serban.constantinescu@arm.com>
Subject: [PATCH 1/2] staging: android: ashmem: fix ashmem pin/unpin interface
Date: Fri, 1 Feb 2013 16:08:00 +0000 [thread overview]
Message-ID: <1359734881-15093-2-git-send-email-serban.constantinescu@arm.com> (raw)
In-Reply-To: <1359734881-15093-1-git-send-email-serban.constantinescu@arm.com>
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>
---
drivers/staging/android/ashmem.c | 2 +-
drivers/staging/android/ashmem.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index 72064fc..aa52646 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -596,7 +596,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 1976b10..c9b2eba 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
--
1.7.9.5
next prev parent reply other threads:[~2013-02-01 16:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-01 16:07 [PATCH 0/2] staging: android: ashmem: add 32bit compat support Serban Constantinescu
2013-02-01 16:08 ` Serban Constantinescu [this message]
2013-02-01 16:18 ` [PATCH 1/2] staging: android: ashmem: fix ashmem pin/unpin interface Greg KH
2013-02-01 16:55 ` Serban Constantinescu
2013-02-04 1:41 ` Greg KH
2013-02-04 10:54 ` Serban Constantinescu
2013-02-01 16:08 ` [PATCH 2/2] staging: android: ashmem: Add support for 32bit ashmem calls in a 64bit kernel 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=1359734881-15093-2-git-send-email-serban.constantinescu@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
all inboxes | Powered by JetHome®