[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <067e97c37957415da24af8237a6846646836fa79.1264624292.git.joe@perches.com>
Date: Wed, 27 Jan 2010 12:46:29 -0800
From: Joe Perches <joe@...ches.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, Jiri Slaby <jirislaby@...il.com>,
Marcin Slusarz <marcin.slusarz@...il.com>,
Stephen Hemminger <shemminger@...tta.com>,
Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
Subject: [PATCH 13/13] 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@...ches.com>
---
drivers/block/floppy.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 623fda5..389ae43 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,
struct floppy_max_errors max_errors;
struct floppy_drive_params dp;
} 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.
* 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,
return set_geometry(cmd, &inparam.g, drive, type, bdev);
case FDGETPRM:
ret = get_floppy_geometry(drive, type,
- (struct floppy_struct **)
- &outparam);
+ (struct floppy_struct **)&outparam);
if (ret)
return ret;
break;
@@ -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);
return 0;
case FDGETMAXERRS:
- outparam = (const char *)&UDP->max_errors;
+ outparam = &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);
+ SUPBOUND(size, strlen((const char *)outparam) + 1);
break;
case FDSETDRVPRM:
*UDP = inparam.dp;
break;
case FDGETDRVPRM:
- outparam = (const char *)UDP;
+ outparam = UDP;
break;
case FDPOLLDRVSTAT:
if (lock_fdc(drive, true))
@@ -3554,18 +3553,18 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
process_fd_request();
/* fall through */
case FDGETDRVSTAT:
- outparam = (const char *)UDRS;
+ outparam = UDRS;
break;
case FDRESET:
return user_reset_fdc(drive, (int)param, true);
case FDGETFDCSTAT:
- outparam = (const char *)UFDCS;
+ outparam = UFDCS;
break;
case FDWERRORCLR:
memset(UDRWE, 0, sizeof(*UDRWE));
return 0;
case FDWERRORGET:
- outparam = (const char *)UDRWE;
+ outparam = UDRWE;
break;
case FDRAWCMD:
if (type)
--
1.6.6.rc0.57.gad7a
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists