Commit 2c7af511 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

[PATCH] m68k: ataflop __user annotations, NULL noise removal

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8a423e54
...@@ -1361,7 +1361,7 @@ static int floppy_revalidate(struct gendisk *disk) ...@@ -1361,7 +1361,7 @@ static int floppy_revalidate(struct gendisk *disk)
formats, for 'permanent user-defined' parameter: formats, for 'permanent user-defined' parameter:
restore default_params[] here if flagged valid! */ restore default_params[] here if flagged valid! */
if (default_params[drive].blocks == 0) if (default_params[drive].blocks == 0)
UDT = 0; UDT = NULL;
else else
UDT = &default_params[drive]; UDT = &default_params[drive];
} }
...@@ -1495,6 +1495,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, ...@@ -1495,6 +1495,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
struct floppy_struct getprm; struct floppy_struct getprm;
int settype; int settype;
struct floppy_struct setprm; struct floppy_struct setprm;
void __user *argp = (void __user *)param;
switch (cmd) { switch (cmd) {
case FDGETPRM: case FDGETPRM:
...@@ -1521,7 +1522,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, ...@@ -1521,7 +1522,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
getprm.head = 2; getprm.head = 2;
getprm.track = dtp->blocks/dtp->spt/2; getprm.track = dtp->blocks/dtp->spt/2;
getprm.stretch = dtp->stretch; getprm.stretch = dtp->stretch;
if (copy_to_user((void *)param, &getprm, sizeof(getprm))) if (copy_to_user(argp, &getprm, sizeof(getprm)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -1540,7 +1541,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, ...@@ -1540,7 +1541,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
/* get the parameters from user space */ /* get the parameters from user space */
if (floppy->ref != 1 && floppy->ref != -1) if (floppy->ref != 1 && floppy->ref != -1)
return -EBUSY; return -EBUSY;
if (copy_from_user(&setprm, (void *) param, sizeof(setprm))) if (copy_from_user(&setprm, argp, sizeof(setprm)))
return -EFAULT; return -EFAULT;
/* /*
* first of all: check for floppy change and revalidate, * first of all: check for floppy change and revalidate,
...@@ -1647,7 +1648,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, ...@@ -1647,7 +1648,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
case FDFMTTRK: case FDFMTTRK:
if (floppy->ref != 1 && floppy->ref != -1) if (floppy->ref != 1 && floppy->ref != -1)
return -EBUSY; return -EBUSY;
if (copy_from_user(&fmt_desc, (void *) param, sizeof(fmt_desc))) if (copy_from_user(&fmt_desc, argp, sizeof(fmt_desc)))
return -EFAULT; return -EFAULT;
return do_format(drive, type, &fmt_desc); return do_format(drive, type, &fmt_desc);
case FDCLRPRM: case FDCLRPRM:
......
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