Commit fe2a5a14 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: paride annotation

parent 8a2e7a53
...@@ -337,7 +337,7 @@ static int pf_open(struct inode *inode, struct file *file) ...@@ -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) 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 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; struct hd_geometry g;
sector_t capacity; sector_t capacity;
......
...@@ -212,9 +212,9 @@ MODULE_PARM(drive3, "1-6i"); ...@@ -212,9 +212,9 @@ MODULE_PARM(drive3, "1-6i");
static int pg_open(struct inode *inode, struct file *file); static int pg_open(struct inode *inode, struct file *file);
static int pg_release(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); 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); size_t count, loff_t * ppos);
static int pg_detect(void); static int pg_detect(void);
...@@ -571,7 +571,7 @@ static int pg_release(struct inode *inode, struct file *file) ...@@ -571,7 +571,7 @@ static int pg_release(struct inode *inode, struct file *file)
return 0; 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 *dev = filp->private_data;
struct pg_write_hdr hdr; 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 ...@@ -582,7 +582,7 @@ static ssize_t pg_write(struct file *filp, const char *buf, size_t count, loff_t
if (count < hs) if (count < hs)
return -EINVAL; return -EINVAL;
if (copy_from_user((char *) &hdr, buf, hs)) if (copy_from_user(&hdr, buf, hs))
return -EFAULT; return -EFAULT;
if (hdr.magic != PG_MAGIC) 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 ...@@ -619,7 +619,7 @@ static ssize_t pg_write(struct file *filp, const char *buf, size_t count, loff_t
return count; 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 *dev = filp->private_data;
struct pg_read_hdr hdr; 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) ...@@ -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.duration = (jiffies - dev->start + HZ / 2) / HZ;
hdr.scsi = dev->status & 0x0f; hdr.scsi = dev->status & 0x0f;
if (copy_to_user(buf, (char *) &hdr, hs)) if (copy_to_user(buf, &hdr, hs))
return -EFAULT; return -EFAULT;
if (copy > 0) if (copy > 0)
if (copy_to_user(buf + hs, dev->bufptr, copy)) if (copy_to_user(buf + hs, dev->bufptr, copy))
......
...@@ -212,9 +212,9 @@ static int pt_open(struct inode *inode, struct file *file); ...@@ -212,9 +212,9 @@ static int pt_open(struct inode *inode, struct file *file);
static int pt_ioctl(struct inode *inode, struct file *file, static int pt_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
static int pt_release(struct inode *inode, struct file *file); 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); 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); size_t count, loff_t * ppos);
static int pt_detect(void); static int pt_detect(void);
...@@ -710,12 +710,12 @@ static int pt_ioctl(struct inode *inode, struct file *file, ...@@ -710,12 +710,12 @@ static int pt_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
struct pt_unit *tape = file->private_data; struct pt_unit *tape = file->private_data;
struct mtop __user *p = (void __user *)arg;
struct mtop mtop; struct mtop mtop;
switch (cmd) { switch (cmd) {
case MTIOCTOP: case MTIOCTOP:
if (copy_from_user((char *) &mtop, (char *) arg, if (copy_from_user(&mtop, p, sizeof(struct mtop)))
sizeof (struct mtop)))
return -EFAULT; return -EFAULT;
switch (mtop.mt_op) { switch (mtop.mt_op) {
...@@ -764,7 +764,7 @@ pt_release(struct inode *inode, struct file *file) ...@@ -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 pt_unit *tape = filp->private_data;
struct pi_adapter *pi = tape->pi; 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 ...@@ -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 pt_unit *tape = filp->private_data;
struct pi_adapter *pi = tape->pi; struct pi_adapter *pi = tape->pi;
......
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