Commit 724ee626 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

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: 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 0aad92cf
...@@ -3431,7 +3431,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, ...@@ -3431,7 +3431,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
struct floppy_max_errors max_errors; struct floppy_max_errors max_errors;
struct floppy_drive_params dp; struct floppy_drive_params dp;
} inparam; /* parameters coming from user space */ } inparam; /* parameters coming from user space */
const char *outparam; /* parameters passed back to user space */ const void *outparam; /* parameters passed back to user space */
/* convert compatibility eject ioctls into floppy eject ioctl. /* convert compatibility eject ioctls into floppy eject ioctl.
* We do this in order to provide a means to eject floppy disks before * 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,8 +3495,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
return set_geometry(cmd, &inparam.g, drive, type, bdev); return set_geometry(cmd, &inparam.g, drive, type, bdev);
case FDGETPRM: case FDGETPRM:
ret = get_floppy_geometry(drive, type, ret = get_floppy_geometry(drive, type,
(struct floppy_struct **) (struct floppy_struct **)&outparam);
&outparam);
if (ret) if (ret)
return ret; return ret;
break; break;
...@@ -3531,20 +3530,20 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, ...@@ -3531,20 +3530,20 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
UDP->max_errors.reporting = (unsigned short)(param & 0x0f); UDP->max_errors.reporting = (unsigned short)(param & 0x0f);
return 0; return 0;
case FDGETMAXERRS: case FDGETMAXERRS:
outparam = (const char *)&UDP->max_errors; outparam = &UDP->max_errors;
break; break;
case FDSETMAXERRS: case FDSETMAXERRS:
UDP->max_errors = inparam.max_errors; UDP->max_errors = inparam.max_errors;
break; break;
case FDGETDRVTYP: case FDGETDRVTYP:
outparam = drive_name(type, drive); outparam = drive_name(type, drive);
SUPBOUND(size, strlen(outparam) + 1); SUPBOUND(size, strlen((const char *)outparam) + 1);
break; break;
case FDSETDRVPRM: case FDSETDRVPRM:
*UDP = inparam.dp; *UDP = inparam.dp;
break; break;
case FDGETDRVPRM: case FDGETDRVPRM:
outparam = (const char *)UDP; outparam = UDP;
break; break;
case FDPOLLDRVSTAT: case FDPOLLDRVSTAT:
if (lock_fdc(drive, true)) if (lock_fdc(drive, true))
...@@ -3554,18 +3553,18 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, ...@@ -3554,18 +3553,18 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
process_fd_request(); process_fd_request();
/* fall through */ /* fall through */
case FDGETDRVSTAT: case FDGETDRVSTAT:
outparam = (const char *)UDRS; outparam = UDRS;
break; break;
case FDRESET: case FDRESET:
return user_reset_fdc(drive, (int)param, true); return user_reset_fdc(drive, (int)param, true);
case FDGETFDCSTAT: case FDGETFDCSTAT:
outparam = (const char *)UFDCS; outparam = UFDCS;
break; break;
case FDWERRORCLR: case FDWERRORCLR:
memset(UDRWE, 0, sizeof(*UDRWE)); memset(UDRWE, 0, sizeof(*UDRWE));
return 0; return 0;
case FDWERRORGET: case FDWERRORGET:
outparam = (const char *)UDRWE; outparam = UDRWE;
break; break;
case FDRAWCMD: case FDRAWCMD:
if (type) if (type)
......
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