Commit da273653 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

drivers/block/floppy.c: remove IN/OUT macros, indent switch/case

Remove ugly IN/OUT macros, use direct case and code
Add missing semicolon after ECALL
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 96534f1d
......@@ -3466,8 +3466,6 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
unsigned long param)
{
#define FD_IOCTL_ALLOWED (mode & (FMODE_WRITE|FMODE_WRITE_IOCTL))
#define OUT(c,x) case c: outparam = (const char *) (x); break
#define IN(c,x,tag) case c: *(x) = inparam. tag ; return 0
int drive = (long)bdev->bd_disk->private_data;
int type = ITYPE(UDRS->fd_device);
......@@ -3509,7 +3507,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
/* copyin */
memset(&inparam, 0, sizeof(inparam));
if (_IOC_DIR(cmd) & _IOC_WRITE)
ECALL(fd_copyin((void __user *)param, &inparam, size))
ECALL(fd_copyin((void __user *)param, &inparam, size));
switch (cmd) {
case FDEJECT:
......@@ -3534,21 +3532,18 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
return invalidate_drive(bdev);
case FDSETPRM:
case FDDEFPRM:
return set_geometry(cmd, &inparam.g,
drive, type, bdev);
return set_geometry(cmd, &inparam.g, drive, type, bdev);
case FDGETPRM:
ECALL(get_floppy_geometry(drive, type,
(struct floppy_struct **)
&outparam));
break;
case FDMSGON:
UDP->flags |= FTD_MSG;
return 0;
case FDMSGOFF:
UDP->flags &= ~FTD_MSG;
return 0;
case FDFMTBEG:
LOCK_FDC(drive, 1);
CALL(poll_drive(1, FD_RAW_NEED_DISK));
......@@ -3567,39 +3562,44 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
case FDFLUSH:
LOCK_FDC(drive, 1);
return invalidate_drive(bdev);
case FDSETEMSGTRESH:
UDP->max_errors.reporting =
(unsigned short)(param & 0x0f);
UDP->max_errors.reporting = (unsigned short)(param & 0x0f);
return 0;
OUT(FDGETMAXERRS, &UDP->max_errors);
IN(FDSETMAXERRS, &UDP->max_errors, max_errors);
case FDGETMAXERRS:
outparam = (const char *)&UDP->max_errors;
break;
case FDSETMAXERRS:
UDP->max_errors = inparam.max_errors;
break;
case FDGETDRVTYP:
outparam = drive_name(type, drive);
SUPBOUND(size, strlen(outparam) + 1);
break;
IN(FDSETDRVPRM, UDP, dp);
OUT(FDGETDRVPRM, UDP);
case FDSETDRVPRM:
*UDP = inparam.dp;
break;
case FDGETDRVPRM:
outparam = (const char *)UDP;
break;
case FDPOLLDRVSTAT:
LOCK_FDC(drive, 1);
CALL(poll_drive(1, FD_RAW_NEED_DISK));
process_fd_request();
/* fall through */
OUT(FDGETDRVSTAT, UDRS);
case FDGETDRVSTAT:
outparam = (const char *)UDRS;
break;
case FDRESET:
return user_reset_fdc(drive, (int)param, 1);
OUT(FDGETFDCSTAT, UFDCS);
case FDGETFDCSTAT:
outparam = (const char *)UFDCS;
break;
case FDWERRORCLR:
memset(UDRWE, 0, sizeof(*UDRWE));
return 0;
OUT(FDWERRORGET, UDRWE);
case FDWERRORGET:
outparam = (const char *)UDRWE;
break;
case FDRAWCMD:
if (type)
return -EINVAL;
......@@ -3608,23 +3608,19 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
CALL(i = raw_cmd_ioctl(cmd, (void __user *)param));
process_fd_request();
return i;
case FDTWADDLE:
LOCK_FDC(drive, 1);
twaddle();
process_fd_request();
return 0;
default:
return -EINVAL;
}
if (_IOC_DIR(cmd) & _IOC_READ)
return fd_copyout((void __user *)param, outparam, size);
else
return 0;
#undef OUT
#undef IN
}
static void __init config_types(void)
......
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