staging: binder: add __user annotation in binder.c
PATCH RESEND 1/2 staging: binder: add __user annotation in binder.c
Add __user to binder_version to correct sparse warning. Reduce line size to fit to coding style.
--- drivers/staging/android/binder.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/staging/android/binder.c +6 -2
@@ -2683,16 +2683,20 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)binder_free_thread (proc, thread); thread =NULL ;break ; -case BINDER_VERSION : +case BINDER_VERSION :{ +struct binder_version __user *ver = ubuf; +if (size !=sizeof (struct binder_version )) { ret = -EINVAL ; goto err; } -if (put_user (BINDER_CURRENT_PROTOCOL_VERSION , &((struct binder_version *)ubuf)->protocol_version)) { +if (put_user (BINDER_CURRENT_PROTOCOL_VERSION , + &ver->protocol_version)) { ret = -EINVAL ; goto err; }break ; + }default : ret = -EINVAL ; goto err;
Signature · 1 line
1.8.3.2
PATCH RESEND 2/2 staging: binder: Code simplification
Remove duplicate code
--- drivers/staging/android/binder.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/staging/android/binder.c +2 -5
@@ -2686,11 +2686,8 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)case BINDER_VERSION :{struct binder_version __user *ver = ubuf; -if (size !=sizeof (struct binder_version )) { - ret = -EINVAL ; - goto err; - } -if (put_user (BINDER_CURRENT_PROTOCOL_VERSION , +if (size !=sizeof (struct binder_version ) || +put_user (BINDER_CURRENT_PROTOCOL_VERSION , &ver->protocol_version)) { ret = -EINVAL ; goto err;
Signature · 1 line
1.8.3.2
Re: [PATCH RESEND 2/2] staging: binder: Code simplification
Quoted 2 lines · Mathieu Maret
Remove duplicate code
The original code is simpler actually.
regards,
dan carpenter
Greg KH
maintainerRe: [PATCH RESEND 2/2] staging: binder: Code simplification
In reply to Mathieu MaretQuoted 15 lines · Mathieu Maret
Remove duplicate code
Signed-off-by Mathieu Maret <[email protected]>--- drivers/staging/android/binder.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)drivers/staging/android/binder.c +0
-0@@ -2686,11 +2686,8 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)case BINDER_VERSION :{struct binder_version __user *ver = ubuf;
drivers/staging/android/binder.c static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · line 2693
Quoted 10 lines
drivers/staging/android/binder.c +2
-5-if (size !=sizeof (struct binder_version )) { - ret = -EINVAL ; - goto err; - } -if (put_user (BINDER_CURRENT_PROTOCOL_VERSION , +if (size !=sizeof (struct binder_version ) || +put_user (BINDER_CURRENT_PROTOCOL_VERSION , &ver->protocol_version)) { ret = -EINVAL ; goto err;
I agree with Dan, the original code was easier to read.
thanks,
greg k-h
This is the first time you have sent it to the list, it's not a RESEND.
Patch looks ok.
regards,
dan carpenter
Quoted 2 lines · Dan Carpenter
This is the first time you have sent it to the list, it's not a RESEND.
The first one was only on the linux-kernel mailing list. May be, that's why you did not get it.
As it was just before the 3.14 release, I was asked to resend latter.
Is it the expected meaning of the "RESEND" tag?
Quoted 1 line
Patch looks ok.
Cool
Quoted 4 lines
regards,
dan carpenter
Regards,
Mathieu
Quoted 4 lines · Mathieu Maret
Quoted 2 lines · Dan Carpenter
This is the first time you have sent it to the list, it's not a RESEND.
The first one was only on the linux-kernel mailing list.
Oh. No one reads lkml. It's just for the google archive.
regards,
dan carpenter