All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arch/score/include/asm/uaccess.h: Use standard clear_user() prototype
@ 2014-06-22 12:29 Chen Gang
  2014-06-25 15:29 ` Lennox Wu
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Gang @ 2014-06-22 12:29 UTC (permalink / raw)
  To: Liqin Chen, Lennox Wu, Guenter Roeck; +Cc: linux-kernel

Use standard clear_user() just like another architectures, also match
__clear_user() under score.

The related warning (allmodconfig under score):

    CC [M]  drivers/md/dm-ioctl.o
  drivers/md/dm-ioctl.c: In function 'copy_params':
  drivers/md/dm-ioctl.c:1728:33: warning: passing argument 1 of 'clear_user' from incompatible pointer type
     if (secure_data && clear_user(user, param_kernel->data_size))
                                   ^
  In file included from include/linux/uaccess.h:5:0,
                   from include/linux/highmem.h:8,
                   from include/linux/bio.h:23,
                   from include/linux/device-mapper.h:11,
                   from drivers/md/dm.h:14,
                   from drivers/md/dm-ioctl.c:8:
  ./arch/score/include/asm/uaccess.h:364:29: note: expected 'char *' but argument is of type 'struct dm_ioctl *'
   static inline unsigned long clear_user(char *src, unsigned long size)
                               ^

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 arch/score/include/asm/uaccess.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/score/include/asm/uaccess.h b/arch/score/include/asm/uaccess.h
index ab66ddd..259a539 100644
--- a/arch/score/include/asm/uaccess.h
+++ b/arch/score/include/asm/uaccess.h
@@ -361,7 +361,8 @@ copy_in_user(void *to, const void *from, unsigned long len)
  */
 extern unsigned long __clear_user(void __user *src, unsigned long size);
 
-static inline unsigned long clear_user(char *src, unsigned long size)
+static inline unsigned long __must_check clear_user(void __user *src,
+							unsigned long size)
 {
 	if (access_ok(VERIFY_WRITE, src, size))
 		return __clear_user(src, size);
-- 
1.9.2.459.g68773ac

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] arch/score/include/asm/uaccess.h: Use standard clear_user() prototype
  2014-06-22 12:29 [PATCH] arch/score/include/asm/uaccess.h: Use standard clear_user() prototype Chen Gang
@ 2014-06-25 15:29 ` Lennox Wu
  2014-06-25 22:11   ` Chen Gang
  0 siblings, 1 reply; 3+ messages in thread
From: Lennox Wu @ 2014-06-25 15:29 UTC (permalink / raw)
  To: Chen Gang; +Cc: Liqin Chen, Guenter Roeck, linux-kernel

Thanks for the patch.

Acked-by: Lennox Wu<lennox.wu@gmail.com>

2014-06-22 20:29 GMT+08:00 Chen Gang <gang.chen.5i5j@gmail.com>:
> Use standard clear_user() just like another architectures, also match
> __clear_user() under score.
>
> The related warning (allmodconfig under score):
>
>     CC [M]  drivers/md/dm-ioctl.o
>   drivers/md/dm-ioctl.c: In function 'copy_params':
>   drivers/md/dm-ioctl.c:1728:33: warning: passing argument 1 of 'clear_user' from incompatible pointer type
>      if (secure_data && clear_user(user, param_kernel->data_size))
>                                    ^
>   In file included from include/linux/uaccess.h:5:0,
>                    from include/linux/highmem.h:8,
>                    from include/linux/bio.h:23,
>                    from include/linux/device-mapper.h:11,
>                    from drivers/md/dm.h:14,
>                    from drivers/md/dm-ioctl.c:8:
>   ./arch/score/include/asm/uaccess.h:364:29: note: expected 'char *' but argument is of type 'struct dm_ioctl *'
>    static inline unsigned long clear_user(char *src, unsigned long size)
>                                ^
>
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
>  arch/score/include/asm/uaccess.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/score/include/asm/uaccess.h b/arch/score/include/asm/uaccess.h
> index ab66ddd..259a539 100644
> --- a/arch/score/include/asm/uaccess.h
> +++ b/arch/score/include/asm/uaccess.h
> @@ -361,7 +361,8 @@ copy_in_user(void *to, const void *from, unsigned long len)
>   */
>  extern unsigned long __clear_user(void __user *src, unsigned long size);
>
> -static inline unsigned long clear_user(char *src, unsigned long size)
> +static inline unsigned long __must_check clear_user(void __user *src,
> +                                                       unsigned long size)
>  {
>         if (access_ok(VERIFY_WRITE, src, size))
>                 return __clear_user(src, size);
> --
> 1.9.2.459.g68773ac

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arch/score/include/asm/uaccess.h: Use standard clear_user() prototype
  2014-06-25 15:29 ` Lennox Wu
@ 2014-06-25 22:11   ` Chen Gang
  0 siblings, 0 replies; 3+ messages in thread
From: Chen Gang @ 2014-06-25 22:11 UTC (permalink / raw)
  To: Lennox Wu; +Cc: Liqin Chen, Guenter Roeck, linux-kernel

On 06/25/2014 11:29 PM, Lennox Wu wrote:
> Thanks for the patch.
> 
> Acked-by: Lennox Wu<lennox.wu@gmail.com>
> 

Thank you for your work, and I shall continue, hope I can finish
allmodconfig for score within next month (2014-07-31).


Thanks.

> 2014-06-22 20:29 GMT+08:00 Chen Gang <gang.chen.5i5j@gmail.com>:
>> Use standard clear_user() just like another architectures, also match
>> __clear_user() under score.
>>
>> The related warning (allmodconfig under score):
>>
>>     CC [M]  drivers/md/dm-ioctl.o
>>   drivers/md/dm-ioctl.c: In function 'copy_params':
>>   drivers/md/dm-ioctl.c:1728:33: warning: passing argument 1 of 'clear_user' from incompatible pointer type
>>      if (secure_data && clear_user(user, param_kernel->data_size))
>>                                    ^
>>   In file included from include/linux/uaccess.h:5:0,
>>                    from include/linux/highmem.h:8,
>>                    from include/linux/bio.h:23,
>>                    from include/linux/device-mapper.h:11,
>>                    from drivers/md/dm.h:14,
>>                    from drivers/md/dm-ioctl.c:8:
>>   ./arch/score/include/asm/uaccess.h:364:29: note: expected 'char *' but argument is of type 'struct dm_ioctl *'
>>    static inline unsigned long clear_user(char *src, unsigned long size)
>>                                ^
>>
>> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
>> ---
>>  arch/score/include/asm/uaccess.h | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/score/include/asm/uaccess.h b/arch/score/include/asm/uaccess.h
>> index ab66ddd..259a539 100644
>> --- a/arch/score/include/asm/uaccess.h
>> +++ b/arch/score/include/asm/uaccess.h
>> @@ -361,7 +361,8 @@ copy_in_user(void *to, const void *from, unsigned long len)
>>   */
>>  extern unsigned long __clear_user(void __user *src, unsigned long size);
>>
>> -static inline unsigned long clear_user(char *src, unsigned long size)
>> +static inline unsigned long __must_check clear_user(void __user *src,
>> +                                                       unsigned long size)
>>  {
>>         if (access_ok(VERIFY_WRITE, src, size))
>>                 return __clear_user(src, size);
>> --
>> 1.9.2.459.g68773ac


-- 
Chen Gang

Open share and attitude like air water and life which God blessed

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-25 22:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-22 12:29 [PATCH] arch/score/include/asm/uaccess.h: Use standard clear_user() prototype Chen Gang
2014-06-25 15:29 ` Lennox Wu
2014-06-25 22:11   ` Chen Gang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.