staging: speakup: fix warnings by adding __user annotations
Subsystems (2)
PATCH 1/1 staging: speakup: fix warnings by adding __user annotations
This patch fixes the following sparse warnings by adding __user annotations.
drivers/staging/speakup/speakup_soft.c:248:34: warning:
incorrect type in argument 1 (different address spaces) drivers/staging/speakup/speakup_soft.c:248:34:
expected void [noderef] <asn:1>*dst drivers/staging/speakup/speakup_soft.c:248:34:
got char *[assigned] cpdrivers/staging/speakup/speakup_soft.c:272:40: warning:
incorrect type in argument 1 (different address spaces) drivers/staging/speakup/speakup_soft.c:272:40:
expected char const [noderef] <asn:1>*s drivers/staging/speakup/speakup_soft.c:272:40:
got char const *bufdrivers/staging/speakup/speakup_soft.c:306:17: warning:
incorrect type in initializer (incompatible argument 2 (different address spaces)) drivers/staging/speakup/speakup_soft.c:306:17:
expected long ( *read )( ... ) drivers/staging/speakup/speakup_soft.c:306:17:
got long ( static [toplevel] *<noident> )( ... )drivers/staging/speakup/speakup_soft.c:307:18: warning:
incorrect type in initializer (incompatible argument 2 (different address spaces)) drivers/staging/speakup/speakup_soft.c:307:18:
expected long ( *write )( ... ) drivers/staging/speakup/speakup_soft.c:307:18:
got long ( static [toplevel] *<nfile_operationsoident> )( ... )
drivers/staging/speakup/devsynth.c:29:41: warning:
incorrect type in argument 2 (different address spaces) drivers/staging/speakup/devsynth.c:29:41:
expected void const [noderef] <asn:1>*from
drivers/staging/speakup/devsynth.c:29:41: got char const *ptrdrivers/staging/speakup/devsynth.c:62:17: warning:
incorrect type in initializer (incompatible argument 2 (different address spaces)) drivers/staging/speakup/devsynth.c:62:17:
expected long ( *read )( ... ) drivers/staging/speakup/devsynth.c:62:17:
got long ( static [toplevel] *<noident> )( ... )drivers/staging/speakup/devsynth.c:63:18: warning:
incorrect type in initializer (incompatible argument 2 (different address spaces)) drivers/staging/speakup/devsynth.c:63:18:
expected long ( *write )( ... ) drivers/staging/speakup/devsynth.c:63:18:
got long ( static [toplevel] *<noident> )( ... )
--- drivers/staging/speakup/devsynth.c | 10 +++++----- drivers/staging/speakup/speakup_soft.c | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/speakup/devsynth.c +5 -5
@@ -13,11 +13,11 @@static int misc_registered;static int dev_opened; -static ssize_t speakup_file_write (struct file *fp,const char *buffer, -size_t nbytes,loff_t *ppos) +static ssize_t speakup_file_write (struct file *fp,const char __user *buffer, +size_t nbytes,loff_t *ppos) {size_t count = nbytes; -const char *ptr = buffer; +const char __user *ptr = buffer;size_t bytes;unsigned long flags;u_char buf[256 ];
@@ -37,8 +37,8 @@ static ssize_t speakup_file_write(struct file *fp, const char *buffer,return (ssize_t ) nbytes; } -static ssize_t speakup_file_read (struct file *fp,char *buf,size_t nbytes, -loff_t *ppos) +static ssize_t speakup_file_read (struct file *fp,char __user *buf, +size_t nbytes,loff_t *ppos) {return 0 ; }
drivers/staging/speakup/speakup_soft.c +4 -4
@@ -201,11 +201,11 @@ static int softsynth_close(struct inode *inode, struct file *fp)return 0 ; } -static ssize_t softsynth_read (struct file *fp,char *buf,size_t count, +static ssize_t softsynth_read (struct file *fp,char __user *buf,size_t count,loff_t *pos) {int chars_sent =0 ; -char *cp; +char __user *cp;char *init;char ch;int empty;
@@ -263,8 +263,8 @@ static ssize_t softsynth_read(struct file *fp, char *buf, size_t count,static int last_index; -static ssize_t softsynth_write (struct file *fp,const char *buf,size_t count, -loff_t *pos) +static ssize_t softsynth_write (struct file *fp,const char __user *buf, +size_t count,loff_t *pos) {unsigned long supplied_index =0 ;int converted;
Signature · 1 line
1.7.10.4
Quoted 50 lines · Emil Goode, le Wed 22 May 2013 20:53:09 +0200, a écrit :
This patch fixes the following sparse warnings by adding
__userannotations.
drivers/staging/speakup/speakup_soft.c:248:34: warning:
incorrect type in argument 1 (different address spaces)drivers/staging/speakup/speakup_soft.c:248:34:
expected void [noderef] <asn:1>*dstdrivers/staging/speakup/speakup_soft.c:248:34:
got char *[assigned] cpdrivers/staging/speakup/speakup_soft.c:272:40: warning:
incorrect type in argument 1 (different address spaces)drivers/staging/speakup/speakup_soft.c:272:40:
expected char const [noderef] <asn:1>*sdrivers/staging/speakup/speakup_soft.c:272:40:
got char const *bufdrivers/staging/speakup/speakup_soft.c:306:17: warning:
incorrect type in initializer (incompatible argument 2 (different address spaces))drivers/staging/speakup/speakup_soft.c:306:17:
expected long ( *read )( ... )drivers/staging/speakup/speakup_soft.c:306:17:
got long ( static [toplevel] *<noident> )( ... )drivers/staging/speakup/speakup_soft.c:307:18: warning:
incorrect type in initializer (incompatible argument 2 (different address spaces))drivers/staging/speakup/speakup_soft.c:307:18:
expected long ( *write )( ... )drivers/staging/speakup/speakup_soft.c:307:18:
got long ( static [toplevel] *<nfile_operationsoident> )( ... )
drivers/staging/speakup/devsynth.c:29:41: warning:
incorrect type in argument 2 (different address spaces)drivers/staging/speakup/devsynth.c:29:41:
expected void const [noderef] <asn:1>*from
drivers/staging/speakup/devsynth.c:29:41: got char const *ptrdrivers/staging/speakup/devsynth.c:62:17: warning:
incorrect type in initializer (incompatible argument 2 (different address spaces))drivers/staging/speakup/devsynth.c:62:17:
expected long ( *read )( ... )drivers/staging/speakup/devsynth.c:62:17:
got long ( static [toplevel] *<noident> )( ... )drivers/staging/speakup/devsynth.c:63:18: warning:
incorrect type in initializer (incompatible argument 2 (different address spaces))drivers/staging/speakup/devsynth.c:63:18:
expected long ( *write )( ... )drivers/staging/speakup/devsynth.c:63:18:
got long ( static [toplevel] *<noident> )( ... )
Quoted 1 line
Signed-off-by Emil Goode <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html