lkml.org 
[lkml]   [2015]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] staging: comedi: fix cast warning in comedi_compat32.c
On 20/06/15 15:38, Geliang Tang wrote:
> This patch fixes the following sparse warning:
>
> drivers/staging/comedi/comedi_compat32.c:205:16: warning: cast removes
> address space of expression
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
> Changes in v2:
> - compat_ptr() is substituted by 'unsigned long'.
> ---
> drivers/staging/comedi/comedi_compat32.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/comedi/comedi_compat32.c b/drivers/staging/comedi/comedi_compat32.c
> index 2584824..894a50c 100644
> --- a/drivers/staging/comedi/comedi_compat32.c
> +++ b/drivers/staging/comedi/comedi_compat32.c
> @@ -202,7 +202,7 @@ static int get_compat_cmd(struct comedi_cmd __user *cmd,
> err |= __get_user(temp.uint, &cmd32->stop_arg);
> err |= __put_user(temp.uint, &cmd->stop_arg);
> err |= __get_user(temp.uptr, &cmd32->chanlist);
> - err |= __put_user(compat_ptr(temp.uptr), &cmd->chanlist);
> + err |= __put_user((unsigned long)(temp.uptr), &cmd->chanlist);
> err |= __get_user(temp.uint, &cmd32->chanlist_len);
> err |= __put_user(temp.uint, &cmd->chanlist_len);
> err |= __get_user(temp.uptr, &cmd32->data);
>

Now it removes the call to compat_ptr(), so it won't work. Your first
patch was better, apart from exceeding the 80 character line limit.

--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Web: http://www.mev.co.uk/ )=-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2015-06-22 12:01    [W:0.135 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site