public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] drivers: staging: cxt1e1: linux.c - missing __user annotation
@ 2014-07-28  3:08 Anil Belur
  2014-07-28  3:13 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Anil Belur @ 2014-07-28  3:08 UTC (permalink / raw)
  To: daeseok.youn, shaun, gregkh; +Cc: devel, linux-kernel, Anil Belur

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


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

* Re: [PATCH 1/1] drivers: staging: cxt1e1: linux.c - missing __user annotation
  2014-07-28  3:08 [PATCH 1/1] drivers: staging: cxt1e1: linux.c - missing __user annotation Anil Belur
@ 2014-07-28  3:13 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2014-07-28  3:13 UTC (permalink / raw)
  To: Anil Belur; +Cc: daeseok.youn, shaun, devel, linux-kernel

On Mon, Jul 28, 2014 at 08:38:29AM +0530, Anil Belur wrote:
> 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(-)

This file is no longer in my tree, or in linux-next :(

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

end of thread, other threads:[~2014-07-28  3:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-28  3:08 [PATCH 1/1] drivers: staging: cxt1e1: linux.c - missing __user annotation Anil Belur
2014-07-28  3:13 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox