Commit 072ab23d authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: oprofile __user annotation

parent da9a37d7
......@@ -142,7 +142,7 @@ int event_buffer_release(struct inode * inode, struct file * file)
}
ssize_t event_buffer_read(struct file * file, char * buf, size_t count, loff_t * offset)
ssize_t event_buffer_read(struct file * file, char __user * buf, size_t count, loff_t * offset)
{
int retval = -EINVAL;
size_t const max = buffer_size * sizeof(unsigned long);
......
......@@ -19,9 +19,9 @@ unsigned long fs_cpu_buffer_size = 8192;
unsigned long fs_buffer_watershed = 32768; /* FIXME: tune */
static ssize_t pointer_size_read(struct file * file, char * buf, size_t count, loff_t * offset)
static ssize_t pointer_size_read(struct file * file, char __user * buf, size_t count, loff_t * offset)
{
return oprofilefs_ulong_to_user((unsigned long)sizeof(void *), buf, count, offset);
return oprofilefs_ulong_to_user(sizeof(void *), buf, count, offset);
}
......@@ -30,7 +30,7 @@ static struct file_operations pointer_size_fops = {
};
static ssize_t cpu_type_read(struct file * file, char * buf, size_t count, loff_t * offset)
static ssize_t cpu_type_read(struct file * file, char __user * buf, size_t count, loff_t * offset)
{
return oprofilefs_str_to_user(oprofile_ops->cpu_type, buf, count, offset);
}
......@@ -41,13 +41,13 @@ static struct file_operations cpu_type_fops = {
};
static ssize_t enable_read(struct file * file, char * buf, size_t count, loff_t * offset)
static ssize_t enable_read(struct file * file, char __user * buf, size_t count, loff_t * offset)
{
return oprofilefs_ulong_to_user(oprofile_started, buf, count, offset);
}
static ssize_t enable_write(struct file *file, char const * buf, size_t count, loff_t * offset)
static ssize_t enable_write(struct file *file, char const __user * buf, size_t count, loff_t * offset)
{
unsigned long val;
int retval;
......@@ -76,7 +76,7 @@ static struct file_operations enable_fops = {
};
static ssize_t dump_write(struct file *file, char const * buf, size_t count, loff_t * offset)
static ssize_t dump_write(struct file *file, char const __user * buf, size_t count, loff_t * offset)
{
wake_up_buffer_waiter();
return count;
......
......@@ -45,7 +45,7 @@ static struct super_operations s_ops = {
};
ssize_t oprofilefs_str_to_user(char const * str, char * buf, size_t count, loff_t * offset)
ssize_t oprofilefs_str_to_user(char const * str, char __user * buf, size_t count, loff_t * offset)
{
size_t len = strlen(str);
......@@ -69,7 +69,7 @@ ssize_t oprofilefs_str_to_user(char const * str, char * buf, size_t count, loff_
#define TMPBUFSIZE 50
ssize_t oprofilefs_ulong_to_user(unsigned long val, char * buf, size_t count, loff_t * offset)
ssize_t oprofilefs_ulong_to_user(unsigned long val, char __user * buf, size_t count, loff_t * offset)
{
char tmpbuf[TMPBUFSIZE];
size_t maxlen;
......@@ -98,7 +98,7 @@ ssize_t oprofilefs_ulong_to_user(unsigned long val, char * buf, size_t count, lo
}
int oprofilefs_ulong_from_user(unsigned long * val, char const * buf, size_t count)
int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count)
{
char tmpbuf[TMPBUFSIZE];
......@@ -120,14 +120,14 @@ int oprofilefs_ulong_from_user(unsigned long * val, char const * buf, size_t cou
}
static ssize_t ulong_read_file(struct file * file, char * buf, size_t count, loff_t * offset)
static ssize_t ulong_read_file(struct file * file, char __user * buf, size_t count, loff_t * offset)
{
unsigned long * val = file->private_data;
return oprofilefs_ulong_to_user(*val, buf, count, offset);
}
static ssize_t ulong_write_file(struct file * file, char const * buf, size_t count, loff_t * offset)
static ssize_t ulong_write_file(struct file * file, char const __user * buf, size_t count, loff_t * offset)
{
unsigned long * value = file->private_data;
int retval;
......@@ -211,7 +211,7 @@ int oprofilefs_create_ro_ulong(struct super_block * sb, struct dentry * root,
}
static ssize_t atomic_read_file(struct file * file, char * buf, size_t count, loff_t * offset)
static ssize_t atomic_read_file(struct file * file, char __user * buf, size_t count, loff_t * offset)
{
atomic_t * val = file->private_data;
return oprofilefs_ulong_to_user(atomic_read(val), buf, count, offset);
......
......@@ -86,19 +86,19 @@ struct dentry * oprofilefs_mkdir(struct super_block * sb, struct dentry * root,
* Write the given asciz string to the given user buffer @buf, updating *offset
* appropriately. Returns bytes written or -EFAULT.
*/
ssize_t oprofilefs_str_to_user(char const * str, char * buf, size_t count, loff_t * offset);
ssize_t oprofilefs_str_to_user(char const * str, char __user * buf, size_t count, loff_t * offset);
/**
* Convert an unsigned long value into ASCII and copy it to the user buffer @buf,
* updating *offset appropriately. Returns bytes written or -EFAULT.
*/
ssize_t oprofilefs_ulong_to_user(unsigned long val, char * buf, size_t count, loff_t * offset);
ssize_t oprofilefs_ulong_to_user(unsigned long val, char __user * buf, size_t count, loff_t * offset);
/**
* Read an ASCII string for a number from a userspace buffer and fill *val on success.
* Returns 0 on success, < 0 on error.
*/
int oprofilefs_ulong_from_user(unsigned long * val, char const * buf, size_t count);
int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count);
/** lock for read/write safety */
extern spinlock_t oprofilefs_lock;
......
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