aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-03-10 18:20:55 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 18:52:30 -0500
commit4575b55281825d157573bbc5aa28b9144193ddd2 (patch)
treec60f8e878185ecd15075b687e81048671624493e
parente029853612ba5999caed4dbc833dab729aac75ba (diff)
drivers/block/floppy.c: remove most uses of CALL and ECALL macros
Signed-off-by: Joe 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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/block/floppy.c51
1 files changed, 35 insertions, 16 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 35ce4e3f04dd..36cd33cbe44f 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -3151,8 +3151,10 @@ static inline int raw_cmd_copyout(int cmd, char __user *param,
3151 if (ptr->length >= 0 && 3151 if (ptr->length >= 0 &&
3152 ptr->length <= ptr->buffer_length) { 3152 ptr->length <= ptr->buffer_length) {
3153 long length = ptr->buffer_length - ptr->length; 3153 long length = ptr->buffer_length - ptr->length;
3154 ECALL(fd_copyout(ptr->data, ptr->kernel_data, 3154 ret = fd_copyout(ptr->data, ptr->kernel_data,
3155 length)); 3155 length);
3156 if (ret)
3157 return ret;
3156 } 3158 }
3157 } 3159 }
3158 ptr = ptr->next; 3160 ptr = ptr->next;
@@ -3223,9 +3225,12 @@ static inline int raw_cmd_copyin(int cmd, char __user *param,
3223 return -ENOMEM; 3225 return -ENOMEM;
3224 ptr->buffer_length = ptr->length; 3226 ptr->buffer_length = ptr->length;
3225 } 3227 }
3226 if (ptr->flags & FD_RAW_WRITE) 3228 if (ptr->flags & FD_RAW_WRITE) {
3227 ECALL(fd_copyin(ptr->data, ptr->kernel_data, 3229 ret = fd_copyin(ptr->data, ptr->kernel_data,
3228 ptr->length)); 3230 ptr->length);
3231 if (ret)
3232 return ret;
3233 }
3229 rcmd = &(ptr->next); 3234 rcmd = &(ptr->next);
3230 if (!(ptr->flags & FD_RAW_MORE)) 3235 if (!(ptr->flags & FD_RAW_MORE))
3231 return 0; 3236 return 0;
@@ -3329,10 +3334,12 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
3329 3334
3330 if (lock_fdc(drive, 1)) 3335 if (lock_fdc(drive, 1))
3331 return -EINTR; 3336 return -EINTR;
3332 if (cmd != FDDEFPRM) 3337 if (cmd != FDDEFPRM) {
3333 /* notice a disk change immediately, else 3338 /* notice a disk change immediately, else
3334 * we lose our settings immediately*/ 3339 * we lose our settings immediately*/
3335 CALL(poll_drive(1, FD_RAW_NEED_DISK)); 3340 if (poll_drive(1, FD_RAW_NEED_DISK) == -EINTR)
3341 return -EINTR;
3342 }
3336 oldStretch = g->stretch; 3343 oldStretch = g->stretch;
3337 user_params[drive] = *g; 3344 user_params[drive] = *g;
3338 if (buffer_drive == drive) 3345 if (buffer_drive == drive)
@@ -3413,7 +3420,8 @@ static int get_floppy_geometry(int drive, int type, struct floppy_struct **g)
3413 else { 3420 else {
3414 if (lock_fdc(drive, 0)) 3421 if (lock_fdc(drive, 0))
3415 return -EINTR; 3422 return -EINTR;
3416 CALL(poll_drive(0, 0)); 3423 if (poll_drive(0, 0) == -EINTR)
3424 return -EINTR;
3417 process_fd_request(); 3425 process_fd_request();
3418 *g = current_type[drive]; 3426 *g = current_type[drive];
3419 } 3427 }
@@ -3471,7 +3479,9 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
3471 return -EINVAL; 3479 return -EINVAL;
3472 3480
3473 /* convert the old style command into a new style command */ 3481 /* convert the old style command into a new style command */
3474 ECALL(normalize_ioctl(&cmd, &size)); 3482 ret = normalize_ioctl(&cmd, &size);
3483 if (ret)
3484 return ret;
3475 3485
3476 /* permission checks */ 3486 /* permission checks */
3477 if (((cmd & 0x40) && !FD_IOCTL_ALLOWED) || 3487 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 3493
3484 /* copyin */ 3494 /* copyin */
3485 memset(&inparam, 0, sizeof(inparam)); 3495 memset(&inparam, 0, sizeof(inparam));
3486 if (_IOC_DIR(cmd) & _IOC_WRITE) 3496 if (_IOC_DIR(cmd) & _IOC_WRITE) {
3487 ECALL(fd_copyin((void __user *)param, &inparam, size)); 3497 ret = fd_copyin((void __user *)param, &inparam, size);
3498 if (ret)
3499 return ret;
3500 }
3488 3501
3489 switch (cmd) { 3502 switch (cmd) {
3490 case FDEJECT: 3503 case FDEJECT:
@@ -3513,9 +3526,11 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
3513 case FDDEFPRM: 3526 case FDDEFPRM:
3514 return set_geometry(cmd, &inparam.g, drive, type, bdev); 3527 return set_geometry(cmd, &inparam.g, drive, type, bdev);
3515 case FDGETPRM: 3528 case FDGETPRM:
3516 ECALL(get_floppy_geometry(drive, type, 3529 ret = get_floppy_geometry(drive, type,
3517 (struct floppy_struct **) 3530 (struct floppy_struct **)
3518 &outparam)); 3531 &outparam);
3532 if (ret)
3533 return ret;
3519 break; 3534 break;
3520 case FDMSGON: 3535 case FDMSGON:
3521 UDP->flags |= FTD_MSG; 3536 UDP->flags |= FTD_MSG;
@@ -3526,7 +3541,8 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
3526 case FDFMTBEG: 3541 case FDFMTBEG:
3527 if (lock_fdc(drive, 1)) 3542 if (lock_fdc(drive, 1))
3528 return -EINTR; 3543 return -EINTR;
3529 CALL(poll_drive(1, FD_RAW_NEED_DISK)); 3544 if (poll_drive(1, FD_RAW_NEED_DISK) == -EINTR)
3545 return -EINTR;
3530 ret = UDRS->flags; 3546 ret = UDRS->flags;
3531 process_fd_request(); 3547 process_fd_request();
3532 if (ret & FD_VERIFY) 3548 if (ret & FD_VERIFY)
@@ -3565,7 +3581,8 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
3565 case FDPOLLDRVSTAT: 3581 case FDPOLLDRVSTAT:
3566 if (lock_fdc(drive, 1)) 3582 if (lock_fdc(drive, 1))
3567 return -EINTR; 3583 return -EINTR;
3568 CALL(poll_drive(1, FD_RAW_NEED_DISK)); 3584 if (poll_drive(1, FD_RAW_NEED_DISK) == -EINTR)
3585 return -EINTR;
3569 process_fd_request(); 3586 process_fd_request();
3570 /* fall through */ 3587 /* fall through */
3571 case FDGETDRVSTAT: 3588 case FDGETDRVSTAT:
@@ -3588,7 +3605,9 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
3588 if (lock_fdc(drive, 1)) 3605 if (lock_fdc(drive, 1))
3589 return -EINTR; 3606 return -EINTR;
3590 set_floppy(drive); 3607 set_floppy(drive);
3591 CALL(i = raw_cmd_ioctl(cmd, (void __user *)param)); 3608 i = raw_cmd_ioctl(cmd, (void __user *)param);
3609 if (i == -EINTR)
3610 return -EINTR;
3592 process_fd_request(); 3611 process_fd_request();
3593 return i; 3612 return i;
3594 case FDTWADDLE: 3613 case FDTWADDLE: