From: Anil Belur <askb23@gmail.com>
To: daeseok.youn@gmail.com, shaun@xresource.ca, gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Anil Belur <askb23@gmail.com>
Subject: [PATCH 1/1] drivers: staging: cxt1e1: linux.c - missing __user annotation
Date: Mon, 28 Jul 2014 08:38:29 +0530 [thread overview]
Message-ID: <1406516909-5338-1-git-send-email-askb23@gmail.com> (raw)
From: Anil Belur <askb23@gmail.com>
- Some of the functions internally call copy_{to,from}_user() but does
not use '__user'. this patch fixes missing __user annotations.
- this patch fixes the following sparse errors:
drivers/staging/cxt1e1/linux.c:488:33: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/cxt1e1/linux.c:488:33: expected void const [noderef] <asn:1>*from
drivers/staging/cxt1e1/linux.c:488:33: got void *data
drivers/staging/cxt1e1/linux.c:499:26: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/cxt1e1/linux.c:499:26: expected void [noderef] <asn:1>*to
drivers/staging/cxt1e1/linux.c:499:26: got void *data
drivers/staging/cxt1e1/linux.c:512:33: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/cxt1e1/linux.c:512:33: expected void const [noderef] <asn:1>*from
drivers/staging/cxt1e1/linux.c:512:33: got void *data
drivers/staging/cxt1e1/linux.c:534:33: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/cxt1e1/linux.c:534:33: expected void const [noderef] <asn:1>*from
drivers/staging/cxt1e1/linux.c:534:33: got void *data
drivers/staging/cxt1e1/linux.c:550:33: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/cxt1e1/linux.c:550:33: expected void const [noderef] <asn:1>*from
drivers/staging/cxt1e1/linux.c:550:33: got void *data
drivers/staging/cxt1e1/linux.c:558:26: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/cxt1e1/linux.c:558:26: expected void [noderef] <asn:1>*to
drivers/staging/cxt1e1/linux.c:558:26: got void *data
drivers/staging/cxt1e1/linux.c:571:33: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/cxt1e1/linux.c:571:33: expected void const [noderef] <asn:1>*from
drivers/staging/cxt1e1/linux.c:571:33: got void *data
drivers/staging/cxt1e1/linux.c:580:26: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/cxt1e1/linux.c:580:26: expected void [noderef] <asn:1>*to
drivers/staging/cxt1e1/linux.c:580:26: got void *data
drivers/staging/cxt1e1/linux.c:593:33: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/cxt1e1/linux.c:593:33: expected void const [noderef] <asn:1>*from
drivers/staging/cxt1e1/linux.c:593:33: got void *data
drivers/staging/cxt1e1/linux.c:601:26: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/cxt1e1/linux.c:601:26: expected void [noderef] <asn:1>*to
drivers/staging/cxt1e1/linux.c:601:26: got void *data
drivers/staging/cxt1e1/linux.c:612:33: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/cxt1e1/linux.c:612:33: expected void const [noderef] <asn:1>*from
drivers/staging/cxt1e1/linux.c:612:33: got void *data
drivers/staging/cxt1e1/linux.c:620:26: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/cxt1e1/linux.c:620:26: expected void [noderef] <asn:1>*to
drivers/staging/cxt1e1/linux.c:620:26: got void *data
drivers/staging/cxt1e1/linux.c:631:33: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/cxt1e1/linux.c:631:33: expected void const [noderef] <asn:1>*from
drivers/staging/cxt1e1/linux.c:631:33: got void *data
drivers/staging/cxt1e1/linux.c:647:33: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/cxt1e1/linux.c:647:33: expected void const [noderef] <asn:1>*from
drivers/staging/cxt1e1/linux.c:647:33: got void *data
drivers/staging/cxt1e1/linux.c:673:34: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/cxt1e1/linux.c:673:34: expected void const [noderef] <asn:1>*from
drivers/staging/cxt1e1/linux.c:673:34: got void *data
drivers/staging/cxt1e1/linux.c:681:26: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/cxt1e1/linux.c:681:26: expected void [noderef] <asn:1>*to
drivers/staging/cxt1e1/linux.c:681:26: got void *data
drivers/staging/cxt1e1/linux.c:691:47: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/cxt1e1/linux.c:691:47: expected void const [noderef] <asn:1>*from
drivers/staging/cxt1e1/linux.c:691:47: got void *data
drivers/staging/cxt1e1/linux.c:738:33: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/cxt1e1/linux.c:738:33: expected void const [noderef] <asn:1>*from
drivers/staging/cxt1e1/linux.c:738:33: got void *data
drivers/staging/cxt1e1/linux.c:785:33: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/cxt1e1/linux.c:785:33: expected void const [noderef] <asn:1>*from
drivers/staging/cxt1e1/linux.c:785:33: got void *data
drivers/staging/cxt1e1/linux.c:839:14: warning: incorrect type in assignment (different address spaces)
drivers/staging/cxt1e1/linux.c:839:14: expected void *data
drivers/staging/cxt1e1/linux.c:839:14: got void [noderef] <asn:1>*
drivers/staging/cxt1e1/linux.c:840:34: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/cxt1e1/linux.c:840:34: expected void const [noderef] <asn:1>*from
drivers/staging/cxt1e1/linux.c:840:34: got void *data
drivers/staging/cxt1e1/linux.c:891:42: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/cxt1e1/linux.c:891:42: expected void [noderef] <asn:1>*to
drivers/staging/cxt1e1/linux.c:891:42: got void *data
Signed-off-by: Anil Belur <askb23@gmail.com>
---
drivers/staging/cxt1e1/linux.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/staging/cxt1e1/linux.c b/drivers/staging/cxt1e1/linux.c
index 09f3d5c..7e16189 100644
--- a/drivers/staging/cxt1e1/linux.c
+++ b/drivers/staging/cxt1e1/linux.c
@@ -479,7 +479,7 @@ create_chan(struct net_device *ndev, ci_t *ci,
/* the idea here is to get port information and pass it back (using pointer) */
static status_t
-do_get_port(struct net_device *ndev, void *data)
+do_get_port(struct net_device *ndev, void __user *data)
{
int ret;
ci_t *ci; /* ci stands for card information */
@@ -504,7 +504,7 @@ do_get_port(struct net_device *ndev, void *data)
/* this function copys the user data and then calls the real action function */
static status_t
-do_set_port(struct net_device *ndev, void *data)
+do_set_port(struct net_device *ndev, void __user *data)
{
ci_t *ci; /* ci stands for card information */
struct sbecom_port_param pp;/* copy data to kernel land */
@@ -526,7 +526,7 @@ do_set_port(struct net_device *ndev, void *data)
/* work the port loopback mode as per directed */
static status_t
-do_port_loop(struct net_device *ndev, void *data)
+do_port_loop(struct net_device *ndev, void __user *data)
{
struct sbecom_port_param pp;
ci_t *ci;
@@ -541,7 +541,7 @@ do_port_loop(struct net_device *ndev, void *data)
/* set the specified register with the given value / or just read it */
static status_t
-do_framer_rw(struct net_device *ndev, void *data)
+do_framer_rw(struct net_device *ndev, void __user *data)
{
struct sbecom_port_param pp;
ci_t *ci;
@@ -562,7 +562,7 @@ do_framer_rw(struct net_device *ndev, void *data)
/* set the specified register with the given value / or just read it */
static status_t
-do_pld_rw(struct net_device *ndev, void *data)
+do_pld_rw(struct net_device *ndev, void __user *data)
{
struct sbecom_port_param pp;
ci_t *ci;
@@ -584,7 +584,7 @@ do_pld_rw(struct net_device *ndev, void *data)
/* set the specified register with the given value / or just read it */
static status_t
-do_musycc_rw(struct net_device *ndev, void *data)
+do_musycc_rw(struct net_device *ndev, void __user *data)
{
struct c4_musycc_param mp;
ci_t *ci;
@@ -604,7 +604,7 @@ do_musycc_rw(struct net_device *ndev, void *data)
}
static status_t
-do_get_chan(struct net_device *ndev, void *data)
+do_get_chan(struct net_device *ndev, void __user *data)
{
struct sbecom_chan_param cp;
int ret;
@@ -623,7 +623,7 @@ do_get_chan(struct net_device *ndev, void *data)
}
static status_t
-do_set_chan(struct net_device *ndev, void *data)
+do_set_chan(struct net_device *ndev, void __user *data)
{
struct sbecom_chan_param cp;
ci_t *ci;
@@ -637,7 +637,7 @@ do_set_chan(struct net_device *ndev, void *data)
}
static status_t
-do_create_chan(struct net_device *ndev, void *data)
+do_create_chan(struct net_device *ndev, void __user *data)
{
ci_t *ci;
struct net_device *dev;
@@ -665,7 +665,7 @@ do_create_chan(struct net_device *ndev, void *data)
}
static status_t
-do_get_chan_stats(struct net_device *ndev, void *data)
+do_get_chan_stats(struct net_device *ndev, void __user *data)
{
struct c4_chan_stats_wrap ccs;
int ret;
@@ -684,7 +684,7 @@ do_get_chan_stats(struct net_device *ndev, void *data)
return 0;
}
static status_t
-do_set_loglevel(struct net_device *ndev, void *data)
+do_set_loglevel(struct net_device *ndev, void __user *data)
{
unsigned int cxt1e1_log_level;
@@ -728,7 +728,7 @@ do_deluser(struct net_device *ndev, int lockit)
}
int
-do_del_chan(struct net_device *musycc_dev, void *data)
+do_del_chan(struct net_device *musycc_dev, void __user *data)
{
struct sbecom_chan_param cp;
char buf[sizeof(CHANNAME) + 3];
@@ -752,7 +752,7 @@ do_del_chan(struct net_device *musycc_dev, void *data)
int c4_reset_board(void *);
int
-do_reset(struct net_device *musycc_dev, void *data)
+do_reset(struct net_device *musycc_dev, void __user *data)
{
const struct c4_priv *priv;
int i;
@@ -778,7 +778,7 @@ do_reset(struct net_device *musycc_dev, void *data)
}
int
-do_reset_chan_stats(struct net_device *musycc_dev, void *data)
+do_reset_chan_stats(struct net_device *musycc_dev, void __user *data)
{
struct sbecom_chan_param cp;
@@ -792,7 +792,7 @@ static status_t
c4_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd)
{
ci_t *ci;
- void *data;
+ void __user *data;
int iocmd, iolen;
status_t ret;
static struct data {
--
1.9.1
next reply other threads:[~2014-07-28 3:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-28 3:08 Anil Belur [this message]
2014-07-28 3:13 ` [PATCH 1/1] drivers: staging: cxt1e1: linux.c - missing __user annotation Greg KH
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=1406516909-5338-1-git-send-email-askb23@gmail.com \
--to=askb23@gmail.com \
--cc=daeseok.youn@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shaun@xresource.ca \
/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 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.