[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150620103819.GA29626@sudip-PC>
Date: Sat, 20 Jun 2015 16:08:19 +0530
From: Sudip Mukherjee <sudipm.mukherjee@...il.com>
To: Geliang Tang <geliangtang@....com>
Cc: abbotti@....co.uk, hsweeten@...ionengravers.com,
gregkh@...uxfoundation.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: comedi: fix sparse warning in comedi_compat32.c
On Sat, Jun 20, 2015 at 04:49:13PM +0000, 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@....com>
> ---
> 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..29a10fe4 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 int __force *)compat_ptr(temp.uptr), &cmd->chanlist);
compat_ptr is already a typecast.
static inline void __user *compat_ptr(compat_uptr_t uptr)
{
return (void __user *)(unsigned long)uptr;
}
so you are adding another typecast to an already exitsing typecast. :(
and besides, this also introduces one new checkpatch warning of
line more than 80 char.
regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists