Commit 4575b552 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

drivers/block/floppy.c: remove most uses of CALL and ECALL macros

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e0298536
...@@ -3151,8 +3151,10 @@ static inline int raw_cmd_copyout(int cmd, char __user *param, ...@@ -3151,8 +3151,10 @@ static inline int raw_cmd_copyout(int cmd, char __user *param,
if (ptr->length >= 0 && if (ptr->length >= 0 &&
ptr->length <= ptr->buffer_length) { ptr->length <= ptr->buffer_length) {
long length = ptr->buffer_length - ptr->length; long length = ptr->buffer_length - ptr->length;
ECALL(fd_copyout(ptr->data, ptr->kernel_data, ret = fd_copyout(ptr->data, ptr->kernel_data,
length)); length);
if (ret)
return ret;
} }
} }
ptr = ptr->next; ptr = ptr->next;
...@@ -3223,9 +3225,12 @@ static inline int raw_cmd_copyin(int cmd, char __user *param, ...@@ -3223,9 +3225,12 @@ static inline int raw_cmd_copyin(int cmd, char __user *param,
return -ENOMEM; return -ENOMEM;
ptr->buffer_length = ptr->length; ptr->buffer_length = ptr->length;
} }
if (ptr->flags & FD_RAW_WRITE) if (ptr->flags & FD_RAW_WRITE) {
ECALL(fd_copyin(ptr->data, ptr->kernel_data, ret = fd_copyin(ptr->data, ptr->kernel_data,
ptr->length)); ptr->length);
if (ret)
return ret;
}
rcmd = &(ptr->next); rcmd = &(ptr->next);
if (!(ptr->flags & FD_RAW_MORE)) if (!(ptr->flags & FD_RAW_MORE))
return 0; return 0;
...@@ -3329,10 +3334,12 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g, ...@@ -3329,10 +3334,12 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
if (lock_fdc(drive, 1)) if (lock_fdc(drive, 1))
return -EINTR; return -EINTR;
if (cmd != FDDEFPRM) if (cmd != FDDEFPRM) {
/* notice a disk change immediately, else /* notice a disk change immediately, else
* we lose our settings immediately*/ * we lose our settings immediately*/
CALL(poll_drive(1, FD_RAW_NEED_DISK)); if (poll_drive(1, FD_RAW_NEED_DISK) == -EINTR)
return -EINTR;
}
oldStretch = g->stretch; oldStretch = g->stretch;
user_params[drive] = *g; user_params[drive] = *g;
if (buffer_drive == drive) if (buffer_drive == drive)
...@@ -3413,7 +3420,8 @@ static int get_floppy_geometry(int drive, int type, struct floppy_struct **g) ...@@ -3413,7 +3420,8 @@ static int get_floppy_geometry(int drive, int type, struct floppy_struct **g)
else { else {
if (lock_fdc(drive, 0)) if (lock_fdc(drive, 0))
return -EINTR; return -EINTR;
CALL(poll_drive(0, 0)); if (poll_drive(0, 0) == -EINTR)
return -EINTR;
process_fd_request(); process_fd_request();
*g = current_type[drive]; *g = current_type[drive];
} }
...@@ -3471,7 +3479,9 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, ...@@ -3471,7 +3479,9 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
return -EINVAL; return -EINVAL;
/* convert the old style command into a new style command */ /* convert the old style command into a new style command */
ECALL(normalize_ioctl(&cmd, &size)); ret = normalize_ioctl(&cmd, &size);
if (ret)
return ret;
/* permission checks */ /* permission checks */
if (((cmd & 0x40) && !FD_IOCTL_ALLOWED) || if (((cmd & 0x40) && !FD_IOCTL_ALLOWED) ||
...@@ -3483,8 +3493,11 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, ...@@ -3483,8 +3493,11 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
/* copyin */ /* copyin */
memset(&inparam, 0, sizeof(inparam)); memset(&inparam, 0, sizeof(inparam));
if (_IOC_DIR(cmd) & _IOC_WRITE) if (_IOC_DIR(cmd) & _IOC_WRITE) {
ECALL(fd_copyin((void __user *)param, &inparam, size)); ret = fd_copyin((void __user *)param, &inparam, size);
if (ret)
return ret;
}
switch (cmd) { switch (cmd) {
case FDEJECT: case FDEJECT:
...@@ -3513,9 +3526,11 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, ...@@ -3513,9 +3526,11 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
case FDDEFPRM: case FDDEFPRM:
return set_geometry(cmd, &inparam.g, drive, type, bdev); return set_geometry(cmd, &inparam.g, drive, type, bdev);
case FDGETPRM: case FDGETPRM:
ECALL(get_floppy_geometry(drive, type, ret = get_floppy_geometry(drive, type,
(struct floppy_struct **) (struct floppy_struct **)
&outparam)); &outparam);
if (ret)
return ret;
break; break;
case FDMSGON: case FDMSGON:
UDP->flags |= FTD_MSG; UDP->flags |= FTD_MSG;
...@@ -3526,7 +3541,8 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, ...@@ -3526,7 +3541,8 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
case FDFMTBEG: case FDFMTBEG:
if (lock_fdc(drive, 1)) if (lock_fdc(drive, 1))
return -EINTR; return -EINTR;
CALL(poll_drive(1, FD_RAW_NEED_DISK)); if (poll_drive(1, FD_RAW_NEED_DISK) == -EINTR)
return -EINTR;
ret = UDRS->flags; ret = UDRS->flags;
process_fd_request(); process_fd_request();
if (ret & FD_VERIFY) if (ret & FD_VERIFY)
...@@ -3565,7 +3581,8 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, ...@@ -3565,7 +3581,8 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
case FDPOLLDRVSTAT: case FDPOLLDRVSTAT:
if (lock_fdc(drive, 1)) if (lock_fdc(drive, 1))
return -EINTR; return -EINTR;
CALL(poll_drive(1, FD_RAW_NEED_DISK)); if (poll_drive(1, FD_RAW_NEED_DISK) == -EINTR)
return -EINTR;
process_fd_request(); process_fd_request();
/* fall through */ /* fall through */
case FDGETDRVSTAT: case FDGETDRVSTAT:
...@@ -3588,7 +3605,9 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, ...@@ -3588,7 +3605,9 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
if (lock_fdc(drive, 1)) if (lock_fdc(drive, 1))
return -EINTR; return -EINTR;
set_floppy(drive); set_floppy(drive);
CALL(i = raw_cmd_ioctl(cmd, (void __user *)param)); i = raw_cmd_ioctl(cmd, (void __user *)param);
if (i == -EINTR)
return -EINTR;
process_fd_request(); process_fd_request();
return i; return i;
case FDTWADDLE: case FDTWADDLE:
......
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