From 158f9d76bf8becd4a89cf7251a07e2987068981b Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Thu, 3 Jun 2004 07:26:47 -0700 Subject: [PATCH] [PATCH] sparse: coda annotation --- fs/coda/file.c | 4 ++-- fs/coda/pioctl.c | 2 +- fs/coda/psdev.c | 6 +++--- fs/coda/sysctl.c | 8 ++++---- include/linux/coda.h | 5 +++-- include/linux/coda_proc.h | 4 ++-- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/fs/coda/file.c b/fs/coda/file.c index 768b2a1e57504..f0c867c7e258c 100644 --- a/fs/coda/file.c +++ b/fs/coda/file.c @@ -29,7 +29,7 @@ int use_coda_close; static ssize_t -coda_file_read(struct file *coda_file, char *buf, size_t count, loff_t *ppos) +coda_file_read(struct file *coda_file, char __user *buf, size_t count, loff_t *ppos) { struct coda_file_info *cfi; struct file *host_file; @@ -45,7 +45,7 @@ coda_file_read(struct file *coda_file, char *buf, size_t count, loff_t *ppos) } static ssize_t -coda_file_write(struct file *coda_file, const char *buf, size_t count, loff_t *ppos) +coda_file_write(struct file *coda_file, const char __user *buf, size_t count, loff_t *ppos) { struct inode *host_inode, *coda_inode = coda_file->f_dentry->d_inode; struct coda_file_info *cfi; diff --git a/fs/coda/pioctl.c b/fs/coda/pioctl.c index e10ac76438c0b..127714936c666 100644 --- a/fs/coda/pioctl.c +++ b/fs/coda/pioctl.c @@ -58,7 +58,7 @@ static int coda_pioctl(struct inode * inode, struct file * filp, struct coda_inode_info *cnp; /* get the Pioctl data arguments from user space */ - if (copy_from_user(&data, (int *)user_data, sizeof(data))) { + if (copy_from_user(&data, (void __user *)user_data, sizeof(data))) { return -EINVAL; } diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index 14f665e62124c..7d55a28b214c0 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c @@ -88,7 +88,7 @@ static int coda_psdev_ioctl(struct inode * inode, struct file * filp, switch(cmd) { case CIOC_KERNEL_VERSION: data = CODA_KERNEL_VERSION; - return put_user(data, (int *) arg); + return put_user(data, (int __user *) arg); default: return -ENOTTY; } @@ -100,7 +100,7 @@ static int coda_psdev_ioctl(struct inode * inode, struct file * filp, * Receive a message written by Venus to the psdev */ -static ssize_t coda_psdev_write(struct file *file, const char *buf, +static ssize_t coda_psdev_write(struct file *file, const char __user *buf, size_t nbytes, loff_t *off) { struct venus_comm *vcp = (struct venus_comm *) file->private_data; @@ -212,7 +212,7 @@ out: * Read a message from the kernel to Venus */ -static ssize_t coda_psdev_read(struct file * file, char * buf, +static ssize_t coda_psdev_read(struct file * file, char __user * buf, size_t nbytes, loff_t *off) { DECLARE_WAITQUEUE(wait, current); diff --git a/fs/coda/sysctl.c b/fs/coda/sysctl.c index 7c8a136be5194..f1692b56319cf 100644 --- a/fs/coda/sysctl.c +++ b/fs/coda/sysctl.c @@ -69,7 +69,7 @@ void reset_coda_cache_inv_stats( void ) } int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp, - void * buffer, size_t * lenp ) + void __user * buffer, size_t * lenp ) { if ( write ) { reset_coda_vfs_stats(); @@ -83,7 +83,7 @@ int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp, } int do_reset_coda_cache_inv_stats( ctl_table * table, int write, - struct file * filp, void * buffer, + struct file * filp, void __user * buffer, size_t * lenp ) { if ( write ) { @@ -214,7 +214,7 @@ struct proc_dir_entry* proc_fs_coda; #define coda_proc_create(name,get_info) \ create_proc_info_entry(name, 0, proc_fs_coda, get_info) -void coda_sysctl_init() +void coda_sysctl_init(void) { reset_coda_vfs_stats(); reset_coda_cache_inv_stats(); @@ -234,7 +234,7 @@ void coda_sysctl_init() #endif } -void coda_sysctl_clean() +void coda_sysctl_clean(void) { #ifdef CONFIG_SYSCTL diff --git a/include/linux/coda.h b/include/linux/coda.h index 3743f5ef7c47f..eb921d6deae33 100644 --- a/include/linux/coda.h +++ b/include/linux/coda.h @@ -759,13 +759,14 @@ union coda_downcalls { #define PIOCPARM_MASK 0x0000ffff struct ViceIoctl { - caddr_t in, out; /* Data to be transferred in, or out */ + void __user *in; /* Data to be transferred in */ + void __user *out; /* Data to be transferred out */ short in_size; /* Size of input buffer <= 2K */ short out_size; /* Maximum size of output buffer, <= 2K */ }; struct PioctlData { - const char *path; + const char __user *path; int follow; struct ViceIoctl vi; }; diff --git a/include/linux/coda_proc.h b/include/linux/coda_proc.h index 26faac1d91cf6..5bf7521637903 100644 --- a/include/linux/coda_proc.h +++ b/include/linux/coda_proc.h @@ -82,9 +82,9 @@ void reset_coda_cache_inv_stats( void ); * data structure for /proc/sys/... files */ int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp, - void * buffer, size_t * lenp ); + void __user * buffer, size_t * lenp ); int do_reset_coda_cache_inv_stats( ctl_table * table, int write, - struct file * filp, void * buffer, + struct file * filp, void __user * buffer, size_t * lenp ); /* these functions are called to form the content of /proc/fs/coda/... files */ -- 2.53.0