public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Anil Belur <askb23@gmail.com>
Cc: tklauser@distanz.ch, dan.carpenter@oracle.com, bjorn@mork.no,
	silvio.fricke@gmail.com, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] staging: vt6655: ioctl.c - missing __user annotation
Date: Wed, 30 Jul 2014 17:08:54 -0700	[thread overview]
Message-ID: <20140731000854.GA8934@kroah.com> (raw)
In-Reply-To: <1406725197-18530-1-git-send-email-askb23@gmail.com>

On Wed, Jul 30, 2014 at 06:29:57PM +0530, Anil Belur wrote:
> - private_ioctl() internally calls copy_{to,from}_user() and does
>   not use '__user' which gives out several sparse warnings
> - these sparse warnings were fixed by adding __user annotation to
>   the data member of struct tagSCmdRequest:
> 
>  drivers/staging/vt6655/ioctl.c:78:51: warning: incorrect type in argument 2 (different address spaces)
>  drivers/staging/vt6655/ioctl.c:78:51:    expected void const [noderef] asn:1>*from
>  drivers/staging/vt6655/ioctl.c:78:51:    got void *data
> 
> Signed-off-by: Anil Belur <askb23@gmail.com>
> ---
> v2:
> - replaced the 'void __user *' casts by adding '__user' annotation to the data member of struct
>   tagSCmdRequest which is much cleaner approach as suggested by tklauser@distanz.ch
> v1:
> - added 'void __user *' casts to supress the warnings
> 
>  drivers/staging/vt6655/iocmd.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/vt6655/iocmd.h b/drivers/staging/vt6655/iocmd.h
> index e499f1b..dd12498 100644
> --- a/drivers/staging/vt6655/iocmd.h
> +++ b/drivers/staging/vt6655/iocmd.h
> @@ -100,7 +100,7 @@ typedef enum tagWZONETYPE {
>  #pragma pack(1)
>  typedef struct tagSCmdRequest {
>  	u8	    name[16];
> -	void	*data;
> +	void __user *data;
>  	u16	    wResult;
>  	u16     wCmdCode;
>  } SCmdRequest, *PSCmdRequest;

This patch doesn't apply against my tree at all, what did you make it
against?

Always work against linux-next, or the staging-next branch of my
staging.git tree on git.kernel.org.

thanks,

greg k-h

  parent reply	other threads:[~2014-07-31  0:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30 12:59 [PATCH v3] staging: vt6655: ioctl.c - missing __user annotation Anil Belur
2014-07-30 13:26 ` Dan Carpenter
2014-07-31  0:08 ` Greg KH [this message]
2014-07-31  3:16   ` Anil Shashikumar Belur

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=20140731000854.GA8934@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=askb23@gmail.com \
    --cc=bjorn@mork.no \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=silvio.fricke@gmail.com \
    --cc=tklauser@distanz.ch \
    /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