[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <cf276ce1d44fe5fcb1689142e55a9c81c495165b.1264624292.git.joe@perches.com>
Date: Wed, 27 Jan 2010 12:46:24 -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 08/13] drivers/block/floppy.c: Remove some unnecessary casting
Remove char/void __user * use
Remove kmalloc cast
Signed-off-by: Joe Perches <joe@...ches.com>
---
drivers/block/floppy.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 14fefe2..5bad295 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -3104,13 +3104,13 @@ static struct cont_t raw_cmd_cont = {
.done = raw_cmd_done
};
-static inline int raw_cmd_copyout(int cmd, char __user *param,
+static inline int raw_cmd_copyout(int cmd, void __user *param,
struct floppy_raw_cmd *ptr)
{
int ret;
while (ptr) {
- ret = copy_to_user((void __user *)param, ptr, sizeof(*ptr));
+ ret = copy_to_user(param, ptr, sizeof(*ptr));
if (ret)
return -EFAULT;
param += sizeof(struct floppy_raw_cmd);
@@ -3148,7 +3148,7 @@ static void raw_cmd_free(struct floppy_raw_cmd **ptr)
}
}
-static inline int raw_cmd_copyin(int cmd, char __user *param,
+static inline int raw_cmd_copyin(int cmd, void __user *param,
struct floppy_raw_cmd **rcmd)
{
struct floppy_raw_cmd *ptr;
@@ -3157,12 +3157,11 @@ static inline int raw_cmd_copyin(int cmd, char __user *param,
*rcmd = NULL;
while (1) {
- ptr = (struct floppy_raw_cmd *)
- kmalloc(sizeof(struct floppy_raw_cmd), GFP_USER);
+ ptr = kmalloc(sizeof(struct floppy_raw_cmd), GFP_USER);
if (!ptr)
return -ENOMEM;
*rcmd = ptr;
- ret = copy_from_user(ptr, (void __user *)param, sizeof(*ptr));
+ ret = copy_from_user(ptr, param, sizeof(*ptr));
if (ret)
return -EFAULT;
ptr->next = NULL;
--
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