From fe2a5a141977885af85fa5413347926c079cfaaa Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Thu, 3 Jun 2004 06:28:26 -0700 Subject: [PATCH] [PATCH] sparse: paride annotation --- drivers/block/paride/pf.c | 2 +- drivers/block/paride/pg.c | 12 ++++++------ drivers/block/paride/pt.c | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index 1e430e5c8ca45..b4a696e737952 100644 --- a/drivers/block/paride/pf.c +++ b/drivers/block/paride/pf.c @@ -337,7 +337,7 @@ static int pf_open(struct inode *inode, struct file *file) static int pf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { struct pf_unit *pf = inode->i_bdev->bd_disk->private_data; - struct hd_geometry *geo = (struct hd_geometry *) arg; + struct hd_geometry __user *geo = (struct hd_geometry __user *) arg; struct hd_geometry g; sector_t capacity; diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c index 5ccc106fc89d5..d73e3ec9f860e 100644 --- a/drivers/block/paride/pg.c +++ b/drivers/block/paride/pg.c @@ -212,9 +212,9 @@ MODULE_PARM(drive3, "1-6i"); static int pg_open(struct inode *inode, struct file *file); static int pg_release(struct inode *inode, struct file *file); -static ssize_t pg_read(struct file *filp, char *buf, +static ssize_t pg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos); -static ssize_t pg_write(struct file *filp, const char *buf, +static ssize_t pg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos); static int pg_detect(void); @@ -571,7 +571,7 @@ static int pg_release(struct inode *inode, struct file *file) return 0; } -static ssize_t pg_write(struct file *filp, const char *buf, size_t count, loff_t *ppos) +static ssize_t pg_write(struct file *filp, const char __user *buf, size_t count, loff_t *ppos) { struct pg *dev = filp->private_data; struct pg_write_hdr hdr; @@ -582,7 +582,7 @@ static ssize_t pg_write(struct file *filp, const char *buf, size_t count, loff_t if (count < hs) return -EINVAL; - if (copy_from_user((char *) &hdr, buf, hs)) + if (copy_from_user(&hdr, buf, hs)) return -EFAULT; if (hdr.magic != PG_MAGIC) @@ -619,7 +619,7 @@ static ssize_t pg_write(struct file *filp, const char *buf, size_t count, loff_t return count; } -static ssize_t pg_read(struct file *filp, char *buf, size_t count, loff_t *ppos) +static ssize_t pg_read(struct file *filp, char __user *buf, size_t count, loff_t *ppos) { struct pg *dev = filp->private_data; struct pg_read_hdr hdr; @@ -651,7 +651,7 @@ static ssize_t pg_read(struct file *filp, char *buf, size_t count, loff_t *ppos) hdr.duration = (jiffies - dev->start + HZ / 2) / HZ; hdr.scsi = dev->status & 0x0f; - if (copy_to_user(buf, (char *) &hdr, hs)) + if (copy_to_user(buf, &hdr, hs)) return -EFAULT; if (copy > 0) if (copy_to_user(buf + hs, dev->bufptr, copy)) diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c index 81c4690cf4c4c..44b12134d8388 100644 --- a/drivers/block/paride/pt.c +++ b/drivers/block/paride/pt.c @@ -212,9 +212,9 @@ static int pt_open(struct inode *inode, struct file *file); static int pt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); static int pt_release(struct inode *inode, struct file *file); -static ssize_t pt_read(struct file *filp, char *buf, +static ssize_t pt_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos); -static ssize_t pt_write(struct file *filp, const char *buf, +static ssize_t pt_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos); static int pt_detect(void); @@ -710,12 +710,12 @@ static int pt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { struct pt_unit *tape = file->private_data; + struct mtop __user *p = (void __user *)arg; struct mtop mtop; switch (cmd) { case MTIOCTOP: - if (copy_from_user((char *) &mtop, (char *) arg, - sizeof (struct mtop))) + if (copy_from_user(&mtop, p, sizeof(struct mtop))) return -EFAULT; switch (mtop.mt_op) { @@ -764,7 +764,7 @@ pt_release(struct inode *inode, struct file *file) } -static ssize_t pt_read(struct file *filp, char *buf, size_t count, loff_t * ppos) +static ssize_t pt_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) { struct pt_unit *tape = filp->private_data; struct pi_adapter *pi = tape->pi; @@ -861,7 +861,7 @@ static ssize_t pt_read(struct file *filp, char *buf, size_t count, loff_t * ppos } -static ssize_t pt_write(struct file *filp, const char *buf, size_t count, loff_t * ppos) +static ssize_t pt_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) { struct pt_unit *tape = filp->private_data; struct pi_adapter *pi = tape->pi; -- 2.53.0