* request would return the EOF flag for the previous file.
*/
-static ssize_t qic02_tape_read(struct file *filp, char *buf, size_t count, loff_t * ppos)
+static ssize_t qic02_tape_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
{
int type = iminor(filp->f_dentry->d_inode);
unsigned short flags = filp->f_flags;
* tape device again. The driver will detect an exception status in (No Cartridge)
* and force a rewind. After that tar may continue writing.
*/
-static ssize_t qic02_tape_write(struct file *filp, const char *buf, size_t count, loff_t * ppos)
+static ssize_t qic02_tape_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
{
int type = iminor(filp->f_dentry->d_inode);
unsigned short flags = filp->f_flags;
struct mtop operation;
unsigned char blk_addr[6];
struct mtpos ioctl_tell;
+ void __user *argp = (void __user *)ioarg;
if (TP_DIAGS(current_type))
if (c == _IOC_NR(MTIOCGETCONFIG)) {
CHECK_IOC_SIZE(mtconfiginfo);
- if (copy_to_user((char *) ioarg, (char *) &qic02_tape_dynconf, sizeof(qic02_tape_dynconf)))
+ if (copy_to_user(argp, &qic02_tape_dynconf, sizeof(qic02_tape_dynconf)))
return -EFAULT;
return 0;
} else if (c == _IOC_NR(MTIOCSETCONFIG)) {
qic02_release_resources(); /* and go zombie */
/* copy struct from user space to kernel space */
- if (copy_from_user((char *) &qic02_tape_dynconf, (char *) ioarg, sizeof(qic02_tape_dynconf)))
+ if (copy_from_user(&qic02_tape_dynconf, argp, sizeof(qic02_tape_dynconf)))
return -EFAULT;
return update_ifc_masks(qic02_tape_dynconf.ifc_type);
CHECK_IOC_SIZE(mtop);
/* copy mtop struct from user space to kernel space */
- if (copy_from_user((char *) &operation, (char *) ioarg, sizeof(operation)))
+ if (copy_from_user(&operation, argp, sizeof(operation)))
return -EFAULT;
/* ---note: mt_count is signed, negative seeks must be
*/
/* copy results to user space */
- if (copy_to_user((char *) ioarg, (char *) &ioctl_status, sizeof(ioctl_status)))
+ if (copy_to_user(argp, &ioctl_status, sizeof(ioctl_status)))
return -EFAULT;
return 0;
} else if (TP_HAVE_TELL && (c == _IOC_NR(MTIOCPOS))) {
ioctl_tell.mt_blkno = (blk_addr[3] << 16) | (blk_addr[4] << 8) | blk_addr[5];
/* copy results to user space */
- if (copy_to_user((char *) ioarg, (char *) &ioctl_tell, sizeof(ioctl_tell)))
+ if (copy_to_user(argp, &ioctl_tell, sizeof(ioctl_tell)))
return -EFAULT;
return 0;
} /* qic02_tape_ioctl */
-static ssize_t qic02_do_tape_read(struct file *filp, char *buf, size_t count, loff_t * ppos)
+static ssize_t qic02_do_tape_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
{
int err;
return err;
}
-static ssize_t qic02_do_tape_write(struct file *filp, const char *buf, size_t count, loff_t * ppos)
+static ssize_t qic02_do_tape_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
{
int err;