Commit 6d7fee26 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: n_tty annotation

n_tty annotated, ldisc_struct ->read() and ->write() got __user
on their buf argument.
parent 79c58bde
...@@ -249,7 +249,7 @@ static int opost(unsigned char c, struct tty_struct *tty) ...@@ -249,7 +249,7 @@ static int opost(unsigned char c, struct tty_struct *tty)
* things. * things.
*/ */
static ssize_t opost_block(struct tty_struct * tty, static ssize_t opost_block(struct tty_struct * tty,
const unsigned char * inbuf, unsigned int nr) const unsigned char __user * inbuf, unsigned int nr)
{ {
char buf[80]; char buf[80];
int space; int space;
...@@ -946,7 +946,7 @@ static inline int input_available_p(struct tty_struct *tty, int amt) ...@@ -946,7 +946,7 @@ static inline int input_available_p(struct tty_struct *tty, int amt)
* the buffer to head pointer. * the buffer to head pointer.
*/ */
static inline int copy_from_read_buf(struct tty_struct *tty, static inline int copy_from_read_buf(struct tty_struct *tty,
unsigned char **b, unsigned char __user **b,
size_t *nr) size_t *nr)
{ {
...@@ -976,9 +976,9 @@ static inline int copy_from_read_buf(struct tty_struct *tty, ...@@ -976,9 +976,9 @@ static inline int copy_from_read_buf(struct tty_struct *tty,
extern ssize_t redirected_tty_write(struct file *,const char *,size_t,loff_t *); extern ssize_t redirected_tty_write(struct file *,const char *,size_t,loff_t *);
static ssize_t read_chan(struct tty_struct *tty, struct file *file, static ssize_t read_chan(struct tty_struct *tty, struct file *file,
unsigned char *buf, size_t nr) unsigned char __user *buf, size_t nr)
{ {
unsigned char *b = buf; unsigned char __user *b = buf;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
int c; int c;
int minimum, time; int minimum, time;
...@@ -1183,9 +1183,9 @@ static ssize_t read_chan(struct tty_struct *tty, struct file *file, ...@@ -1183,9 +1183,9 @@ static ssize_t read_chan(struct tty_struct *tty, struct file *file,
} }
static ssize_t write_chan(struct tty_struct * tty, struct file * file, static ssize_t write_chan(struct tty_struct * tty, struct file * file,
const unsigned char * buf, size_t nr) const unsigned char __user * buf, size_t nr)
{ {
const unsigned char *b = buf; const unsigned char __user *b = buf;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
int c; int c;
ssize_t retval = 0; ssize_t retval = 0;
......
...@@ -114,9 +114,9 @@ struct tty_ldisc { ...@@ -114,9 +114,9 @@ struct tty_ldisc {
void (*flush_buffer)(struct tty_struct *tty); void (*flush_buffer)(struct tty_struct *tty);
ssize_t (*chars_in_buffer)(struct tty_struct *tty); ssize_t (*chars_in_buffer)(struct tty_struct *tty);
ssize_t (*read)(struct tty_struct * tty, struct file * file, ssize_t (*read)(struct tty_struct * tty, struct file * file,
unsigned char * buf, size_t nr); unsigned char __user * buf, size_t nr);
ssize_t (*write)(struct tty_struct * tty, struct file * file, ssize_t (*write)(struct tty_struct * tty, struct file * file,
const unsigned char * buf, size_t nr); const unsigned char __user * buf, size_t nr);
int (*ioctl)(struct tty_struct * tty, struct file * file, int (*ioctl)(struct tty_struct * tty, struct file * file,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
void (*set_termios)(struct tty_struct *tty, struct termios * old); void (*set_termios)(struct tty_struct *tty, struct termios * old);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment