X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fisdn%2Fhardware%2Feicon%2Fdivamnt.c;h=6b22a8a5f307a819de5f85c440eeffec37fc7337;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=abd70d0d02687cc6953f0fad68dc71469efe6a93;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/drivers/isdn/hardware/eicon/divamnt.c b/drivers/isdn/hardware/eicon/divamnt.c index abd70d0d0..6b22a8a5f 100644 --- a/drivers/isdn/hardware/eicon/divamnt.c +++ b/drivers/isdn/hardware/eicon/divamnt.c @@ -53,7 +53,7 @@ static struct timeval start_time; extern int mntfunc_init(int *, void **, unsigned long); extern void mntfunc_finit(void); -extern int maint_read_write(void *buf, int count); +extern int maint_read_write(void __user *buf, int count); /* * helper functions @@ -90,12 +90,12 @@ void diva_os_free_tbuffer(unsigned long flags, void *ptr) /* * kernel/user space copy functions */ -int diva_os_copy_to_user(void *os_handle, void *dst, const void *src, +int diva_os_copy_to_user(void *os_handle, void __user *dst, const void *src, int length) { return (copy_to_user(dst, src, length)); } -int diva_os_copy_from_user(void *os_handle, void *dst, const void *src, +int diva_os_copy_from_user(void *os_handle, void *dst, const void __user *src, int length) { return (copy_from_user(dst, src, length)); @@ -142,18 +142,15 @@ static struct proc_dir_entry *maint_proc_entry = NULL; to read unstructured traces, formated as ascii string only */ static ssize_t -maint_read(struct file *file, char *buf, size_t count, loff_t * off) +maint_read(struct file *file, char __user *buf, size_t count, loff_t * off) { - diva_dbg_entry_head_t *pmsg = 0; + diva_dbg_entry_head_t *pmsg = NULL; diva_os_spin_lock_magic_t old_irql; word size; char *pstr, *dli_label = "UNK"; int str_length; int *str_msg; - if (off != &file->f_pos) - return -ESPIPE; - if (!file->private_data) { for (;;) { while ( @@ -264,20 +261,20 @@ maint_read(struct file *file, char *buf, size_t count, loff_t * off) if (diva_os_copy_to_user(NULL, buf, pstr, str_length)) { diva_os_free_tbuffer(0, str_msg); - file->private_data = 0; + file->private_data = NULL; return (-EFAULT); } str_msg[1] += str_length; if ((str_msg[0] - str_msg[1]) <= 0) { diva_os_free_tbuffer(0, str_msg); - file->private_data = 0; + file->private_data = NULL; } return (str_length); } static ssize_t -maint_write(struct file *file, const char *buf, size_t count, loff_t * off) +maint_write(struct file *file, const char __user *buf, size_t count, loff_t * off) { return (-ENODEV); } @@ -304,16 +301,16 @@ static int maint_open(struct inode *ino, struct file *filep) opened++; up(&opened_sem); - filep->private_data = 0; + filep->private_data = NULL; - return (0); + return nonseekable_open(ino, filep); } static int maint_close(struct inode *ino, struct file *filep) { if (filep->private_data) { diva_os_free_tbuffer(0, filep->private_data); - filep->private_data = 0; + filep->private_data = NULL; } down(&opened_sem); @@ -360,13 +357,13 @@ static void remove_maint_proc(void) /* * device node operations */ -static ssize_t divas_maint_write(struct file *file, const char *buf, +static ssize_t divas_maint_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos) { - return (maint_read_write((char *) buf, (int) count)); + return (maint_read_write((char __user *) buf, (int) count)); } -static ssize_t divas_maint_read(struct file *file, char *buf, +static ssize_t divas_maint_read(struct file *file, char __user *buf, size_t count, loff_t * ppos) { return (maint_read_write(buf, (int) count)); @@ -416,7 +413,7 @@ static int DIVA_INIT_FUNCTION maint_init(void) { char tmprev[50]; int ret = 0; - void *buffer = 0; + void *buffer = NULL; do_gettimeofday(&start_time); init_waitqueue_head(&msgwaitq);