From: Camille Bordignon <camille.bordignon@gmail.com>
To: arve@android.com
Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org
Subject: [PATCH 1/1] staging: android: Fix warning cast removes address space of expression
Date: Sun, 20 Apr 2014 11:10:57 +0200 [thread overview]
Message-ID: <1397985057.12169.7.camel@vash.home> (raw)
Fix sparse warning "cast removes address space of expression"
Add lost flag "__user" due to cast
Signed-off-by: Camille Bordignon <camille.bordignon@gmail.com>
---
diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index cfe4bc8..952c4ae 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -2683,16 +2683,21 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
binder_free_thread(proc, thread);
thread = NULL;
break;
- case BINDER_VERSION:
- if (size != sizeof(struct binder_version)) {
+ case BINDER_VERSION: {
+ struct binder_version __user *bv = ubuf;
+
+ if (size != sizeof(*bv)) {
ret = -EINVAL;
goto err;
}
- if (put_user(BINDER_CURRENT_PROTOCOL_VERSION, &((struct binder_version *)ubuf)->protocol_version)) {
+
+ if (put_user(BINDER_CURRENT_PROTOCOL_VERSION,
+ &bv->protocol_version)) {
ret = -EINVAL;
goto err;
}
break;
+ }
default:
ret = -EINVAL;
goto err;
next reply other threads:[~2014-04-20 9:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-20 9:10 Camille Bordignon [this message]
2014-04-22 10:36 ` Dan Carpenter
2014-04-25 22:16 ` Greg KH
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=1397985057.12169.7.camel@vash.home \
--to=camille.bordignon@gmail.com \
--cc=arve@android.com \
--cc=devel@driverdev.osuosl.org \
--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®