aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-03-10 18:21:11 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 18:52:31 -0500
commit724ee626f38feaea215a11790e1a0cb5d83b0628 (patch)
tree499e03c265dd8de1d5b145d1a413b45b186b5694 /drivers/block
parent0aad92cfea6fec14bd57dd9c283cc6eb023c97bd (diff)
drivers/block/floppy.c: remove unnecessary casting in fd_ioctl
Convert outparam to const void *. Cast outparam to const char * for strlen(). 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>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/floppy.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 67e8e5f366c5..90c4038702da 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -3431,7 +3431,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
3431 struct floppy_max_errors max_errors; 3431 struct floppy_max_errors max_errors;
3432 struct floppy_drive_params dp; 3432 struct floppy_drive_params dp;
3433 } inparam; /* parameters coming from user space */ 3433 } inparam; /* parameters coming from user space */
3434 const char *outparam; /* parameters passed back to user space */ 3434 const void *outparam; /* parameters passed back to user space */
3435 3435
3436 /* convert compatibility eject ioctls into floppy eject ioctl. 3436 /* convert compatibility eject ioctls into floppy eject ioctl.
3437 * We do this in order to provide a means to eject floppy disks before 3437 * We do this in order to provide a means to eject floppy disks before
@@ -3495,8 +3495,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
3495 return set_geometry(cmd, &inparam.g, drive, type, bdev); 3495 return set_geometry(cmd, &inparam.g, drive, type, bdev);
3496 case FDGETPRM: 3496 case FDGETPRM:
3497 ret = get_floppy_geometry(drive, type, 3497 ret = get_floppy_geometry(drive, type,
3498 (struct floppy_struct **) 3498 (struct floppy_struct **)&outparam);
3499 &outparam);
3500 if (ret) 3499 if (ret)
3501 return ret; 3500 return ret;
3502 break; 3501 break;
@@ -3531,20 +3530,20 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
3531 UDP->max_errors.reporting = (unsigned short)(param & 0x0f); 3530 UDP->max_errors.reporting = (unsigned short)(param & 0x0f);
3532 return 0; 3531 return 0;
3533 case FDGETMAXERRS: 3532 case FDGETMAXERRS:
3534 outparam = (const char *)&UDP->max_errors; 3533 outparam = &UDP->max_errors;
3535 break; 3534 break;
3536 case FDSETMAXERRS: 3535 case FDSETMAXERRS:
3537 UDP->max_errors = inparam.max_errors; 3536 UDP->max_errors = inparam.max_errors;
3538 break; 3537 break;
3539 case FDGETDRVTYP: 3538 case FDGETDRVTYP:
3540 outparam = drive_name(type, drive); 3539 outparam = drive_name(type, drive);
3541 SUPBOUND(size, strlen(outparam) + 1); 3540 SUPBOUND(size, strlen((const char *)outparam) + 1);
3542 break; 3541 break;
3543 case FDSETDRVPRM: 3542 case FDSETDRVPRM:
3544 *UDP = inparam.dp; 3543 *UDP = inparam.dp;
3545 break; 3544 break;
3546 case FDGETDRVPRM: 3545 case FDGETDRVPRM:
3547 outparam = (const char *)UDP; 3546 outparam = UDP;
3548 break; 3547 break;
3549 case FDPOLLDRVSTAT: 3548 case FDPOLLDRVSTAT:
3550 if (lock_fdc(drive, true)) 3549 if (lock_fdc(drive, true))
@@ -3554,18 +3553,18 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
3554 process_fd_request(); 3553 process_fd_request();
3555 /* fall through */ 3554 /* fall through */
3556 case FDGETDRVSTAT: 3555 case FDGETDRVSTAT:
3557 outparam = (const char *)UDRS; 3556 outparam = UDRS;
3558 break; 3557 break;
3559 case FDRESET: 3558 case FDRESET:
3560 return user_reset_fdc(drive, (int)param, true); 3559 return user_reset_fdc(drive, (int)param, true);
3561 case FDGETFDCSTAT: 3560 case FDGETFDCSTAT:
3562 outparam = (const char *)UFDCS; 3561 outparam = UFDCS;
3563 break; 3562 break;
3564 case FDWERRORCLR: 3563 case FDWERRORCLR:
3565 memset(UDRWE, 0, sizeof(*UDRWE)); 3564 memset(UDRWE, 0, sizeof(*UDRWE));
3566 return 0; 3565 return 0;
3567 case FDWERRORGET: 3566 case FDWERRORGET:
3568 outparam = (const char *)UDRWE; 3567 outparam = UDRWE;
3569 break; 3568 break;
3570 case FDRAWCMD: 3569 case FDRAWCMD:
3571 if (type) 3570 if (type)