Commit 8c881385 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: rest of drivers/block annotation

parent fe2a5a14
......@@ -413,7 +413,7 @@ static unsigned long carm_major_alloc;
static int carm_bdev_ioctl(struct inode *ino, struct file *fil,
unsigned int cmd, unsigned long arg)
{
void __user *usermem = (void *) arg;
void __user *usermem = (void __user *) arg;
struct carm_port *port = ino->i_bdev->bd_disk->private_data;
struct hd_geometry geom;
......
......@@ -1063,17 +1063,17 @@ static int ps2esdi_ioctl(struct inode *inode,
struct file *file, u_int cmd, u_long arg)
{
struct ps2esdi_i_struct *p = inode->i_bdev->bd_disk->private_data;
struct ps2esdi_geometry *geometry = (struct ps2esdi_geometry *) arg;
int err;
struct ps2esdi_geometry geom;
if (cmd != HDIO_GETGEO)
return -EINVAL;
if ((err = verify_area(VERIFY_WRITE, geometry, sizeof(*geometry))))
return (err);
put_user(p->head, (char *) &geometry->heads);
put_user(p->sect, (char *) &geometry->sectors);
put_user(p->cyl, (short *) &geometry->cylinders);
put_user(get_start_sect(inode->i_bdev), (long *) &geometry->start);
memset(&geom, 0, sizeof(geom));
geom.heads = p->head;
geom.sectors = p->sect;
geom.cylinders = p->cyl;
geom.start = get_start_sect(inode->i_bdev);
if (copy_to_user((void __user *)arg, &geom, sizeof(geom)))
return -EFAULT;
return 0;
}
......
......@@ -833,7 +833,7 @@ static int mm_ioctl(struct inode *i, struct file *f, unsigned int cmd, unsigned
geo.start = get_start_sect(i->i_bdev);
geo.cylinders = size / (geo.heads * geo.sectors);
if (copy_to_user((void *) arg, &geo, sizeof(geo)))
if (copy_to_user((void __user *) arg, &geo, sizeof(geo)))
return -EFAULT;
return 0;
}
......
......@@ -330,12 +330,12 @@ static int xd_ioctl (struct inode *inode,struct file *file,u_int cmd,u_long arg)
case HDIO_GETGEO:
{
struct hd_geometry g;
struct hd_geometry *geometry = (struct hd_geometry *) arg;
struct hd_geometry __user *geom= (void __user *)arg;
g.heads = p->heads;
g.sectors = p->sectors;
g.cylinders = p->cylinders;
g.start = get_start_sect(inode->i_bdev);
return copy_to_user(geometry, &g, sizeof g) ? -EFAULT : 0;
return copy_to_user(geom, &g, sizeof(g)) ? -EFAULT : 0;
}
case HDIO_SET_DMA:
if (!capable(CAP_SYS_ADMIN)) return -EACCES;
......@@ -354,9 +354,9 @@ static int xd_ioctl (struct inode *inode,struct file *file,u_int cmd,u_long arg)
}
return 0;
case HDIO_GET_DMA:
return put_user(!nodma, (long *) arg);
return put_user(!nodma, (long __user *) arg);
case HDIO_GET_MULTCOUNT:
return put_user(xd_maxsectors, (long *) arg);
return put_user(xd_maxsectors, (long __user *) arg);
default:
return -EINVAL;
}
......
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