Commit 529bbe46 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: trivial part of drivers/scsi/* annotation

parent 5d5cdc9b
...@@ -745,7 +745,7 @@ static const char *idescsi_info (struct Scsi_Host *host) ...@@ -745,7 +745,7 @@ static const char *idescsi_info (struct Scsi_Host *host)
return "SCSI host adapter emulation for IDE ATAPI devices"; return "SCSI host adapter emulation for IDE ATAPI devices";
} }
static int idescsi_ioctl (Scsi_Device *dev, int cmd, void *arg) static int idescsi_ioctl (Scsi_Device *dev, int cmd, void __user *arg)
{ {
idescsi_scsi_t *scsi = scsihost_to_idescsi(dev->host); idescsi_scsi_t *scsi = scsihost_to_idescsi(dev->host);
...@@ -756,7 +756,7 @@ static int idescsi_ioctl (Scsi_Device *dev, int cmd, void *arg) ...@@ -756,7 +756,7 @@ static int idescsi_ioctl (Scsi_Device *dev, int cmd, void *arg)
clear_bit(IDESCSI_SG_TRANSFORM, &scsi->transform); clear_bit(IDESCSI_SG_TRANSFORM, &scsi->transform);
return 0; return 0;
} else if (cmd == SG_GET_TRANSFORM) } else if (cmd == SG_GET_TRANSFORM)
return put_user(test_bit(IDESCSI_SG_TRANSFORM, &scsi->transform), (int *) arg); return put_user(test_bit(IDESCSI_SG_TRANSFORM, &scsi->transform), (int __user *) arg);
return -EINVAL; return -EINVAL;
} }
......
...@@ -4725,6 +4725,7 @@ static int osst_ioctl(struct inode * inode,struct file * file, ...@@ -4725,6 +4725,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
Scsi_Request * SRpnt = NULL; Scsi_Request * SRpnt = NULL;
OS_Scsi_Tape * STp = file->private_data; OS_Scsi_Tape * STp = file->private_data;
char * name = tape_name(STp); char * name = tape_name(STp);
void __user *p = (void __user *)arg;
if (down_interruptible(&STp->lock)) if (down_interruptible(&STp->lock))
return -ERESTARTSYS; return -ERESTARTSYS;
...@@ -4765,7 +4766,7 @@ static int osst_ioctl(struct inode * inode,struct file * file, ...@@ -4765,7 +4766,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
goto out; goto out;
} }
i = copy_from_user((char *) &mtc, (char *)arg, sizeof(struct mtop)); i = copy_from_user((char *) &mtc, p, sizeof(struct mtop));
if (i) { if (i) {
retval = (-EFAULT); retval = (-EFAULT);
goto out; goto out;
...@@ -5003,8 +5004,7 @@ static int osst_ioctl(struct inode * inode,struct file * file, ...@@ -5003,8 +5004,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
STp->drv_buffer != 0) STp->drv_buffer != 0)
mt_status.mt_gstat |= GMT_IM_REP_EN(0xffffffff); mt_status.mt_gstat |= GMT_IM_REP_EN(0xffffffff);
i = copy_to_user((char *)arg, (char *)&mt_status, i = copy_to_user(p, &mt_status, sizeof(struct mtget));
sizeof(struct mtget));
if (i) { if (i) {
retval = (-EFAULT); retval = (-EFAULT);
goto out; goto out;
...@@ -5031,7 +5031,7 @@ static int osst_ioctl(struct inode * inode,struct file * file, ...@@ -5031,7 +5031,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
goto out; goto out;
} }
mt_pos.mt_blkno = blk; mt_pos.mt_blkno = blk;
i = copy_to_user((char *)arg, (char *) (&mt_pos), sizeof(struct mtpos)); i = copy_to_user(p, &mt_pos, sizeof(struct mtpos));
if (i) if (i)
retval = -EFAULT; retval = -EFAULT;
goto out; goto out;
......
...@@ -433,7 +433,7 @@ static int proc_scsi_devinfo_read(char *buffer, char **start, ...@@ -433,7 +433,7 @@ static int proc_scsi_devinfo_read(char *buffer, char **start,
* To add a black/white list entry for vendor and model with an integer * To add a black/white list entry for vendor and model with an integer
* value of flag to the scsi device info list. * value of flag to the scsi device info list.
*/ */
static int proc_scsi_devinfo_write(struct file *file, const char *buf, static int proc_scsi_devinfo_write(struct file *file, const char __user *buf,
unsigned long length, void *data) unsigned long length, void *data)
{ {
char *buffer; char *buffer;
......
...@@ -54,7 +54,7 @@ static int proc_scsi_read(char *buffer, char **start, off_t offset, ...@@ -54,7 +54,7 @@ static int proc_scsi_read(char *buffer, char **start, off_t offset,
return n; return n;
} }
static int proc_scsi_write_proc(struct file *file, const char *buf, static int proc_scsi_write_proc(struct file *file, const char __user *buf,
unsigned long count, void *data) unsigned long count, void *data)
{ {
struct Scsi_Host *shost = data; struct Scsi_Host *shost = data;
......
...@@ -511,7 +511,7 @@ static int sd_release(struct inode *inode, struct file *filp) ...@@ -511,7 +511,7 @@ static int sd_release(struct inode *inode, struct file *filp)
return 0; return 0;
} }
static int sd_hdio_getgeo(struct block_device *bdev, struct hd_geometry *loc) static int sd_hdio_getgeo(struct block_device *bdev, struct hd_geometry __user *loc)
{ {
struct scsi_disk *sdkp = scsi_disk(bdev->bd_disk); struct scsi_disk *sdkp = scsi_disk(bdev->bd_disk);
struct scsi_device *sdp = sdkp->device; struct scsi_device *sdp = sdkp->device;
...@@ -536,7 +536,7 @@ static int sd_hdio_getgeo(struct block_device *bdev, struct hd_geometry *loc) ...@@ -536,7 +536,7 @@ static int sd_hdio_getgeo(struct block_device *bdev, struct hd_geometry *loc)
if (put_user(diskinfo[2], &loc->cylinders)) if (put_user(diskinfo[2], &loc->cylinders))
return -EFAULT; return -EFAULT;
if (put_user((unsigned)get_start_sect(bdev), if (put_user((unsigned)get_start_sect(bdev),
(unsigned long *)&loc->start)) (unsigned long __user *)&loc->start))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -561,6 +561,7 @@ static int sd_ioctl(struct inode * inode, struct file * filp, ...@@ -561,6 +561,7 @@ static int sd_ioctl(struct inode * inode, struct file * filp,
struct block_device *bdev = inode->i_bdev; struct block_device *bdev = inode->i_bdev;
struct gendisk *disk = bdev->bd_disk; struct gendisk *disk = bdev->bd_disk;
struct scsi_device *sdp = scsi_disk(disk)->device; struct scsi_device *sdp = scsi_disk(disk)->device;
void __user *p = (void __user *)arg;
int error; int error;
SCSI_LOG_IOCTL(1, printk("sd_ioctl: disk=%s, cmd=0x%x\n", SCSI_LOG_IOCTL(1, printk("sd_ioctl: disk=%s, cmd=0x%x\n",
...@@ -578,7 +579,7 @@ static int sd_ioctl(struct inode * inode, struct file * filp, ...@@ -578,7 +579,7 @@ static int sd_ioctl(struct inode * inode, struct file * filp,
if (cmd == HDIO_GETGEO) { if (cmd == HDIO_GETGEO) {
if (!arg) if (!arg)
return -EINVAL; return -EINVAL;
return sd_hdio_getgeo(bdev, (struct hd_geometry *)arg); return sd_hdio_getgeo(bdev, p);
} }
/* /*
......
...@@ -3109,6 +3109,7 @@ static int st_ioctl(struct inode *inode, struct file *file, ...@@ -3109,6 +3109,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
ST_mode *STm; ST_mode *STm;
ST_partstat *STps; ST_partstat *STps;
char *name = tape_name(STp); char *name = tape_name(STp);
void __user *p = (void __user *)arg;
if (down_interruptible(&STp->lock)) if (down_interruptible(&STp->lock))
return -ERESTARTSYS; return -ERESTARTSYS;
...@@ -3144,7 +3145,7 @@ static int st_ioctl(struct inode *inode, struct file *file, ...@@ -3144,7 +3145,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
goto out; goto out;
} }
i = copy_from_user((char *) &mtc, (char *) arg, sizeof(struct mtop)); i = copy_from_user(&mtc, p, sizeof(struct mtop));
if (i) { if (i) {
retval = (-EFAULT); retval = (-EFAULT);
goto out; goto out;
...@@ -3380,8 +3381,7 @@ static int st_ioctl(struct inode *inode, struct file *file, ...@@ -3380,8 +3381,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
if (STp->cleaning_req) if (STp->cleaning_req)
mt_status.mt_gstat |= GMT_CLN(0xffffffff); mt_status.mt_gstat |= GMT_CLN(0xffffffff);
i = copy_to_user((char *) arg, (char *) &(mt_status), i = copy_to_user(p, &mt_status, sizeof(struct mtget));
sizeof(struct mtget));
if (i) { if (i) {
retval = (-EFAULT); retval = (-EFAULT);
goto out; goto out;
...@@ -3402,7 +3402,7 @@ static int st_ioctl(struct inode *inode, struct file *file, ...@@ -3402,7 +3402,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
goto out; goto out;
} }
mt_pos.mt_blkno = blk; mt_pos.mt_blkno = blk;
i = copy_to_user((char *) arg, (char *) (&mt_pos), sizeof(struct mtpos)); i = copy_to_user(p, &mt_pos, sizeof(struct mtpos));
if (i) if (i)
retval = (-EFAULT); retval = (-EFAULT);
goto out; goto out;
......
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