diff options
author | Joe Perches <joe@perches.com> | 2010-03-10 18:21:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-12 18:52:31 -0500 |
commit | ce2f11fe784f7999b82c7a71cdbcb86ad2653def (patch) | |
tree | 252cdbf6f0e2e5417f0aa4c60d8ddd0947ecd90e | |
parent | 1ebddd85a6a6ad793eca82d65fba4573d0e28042 (diff) |
drivers/block/floppy.c: remove some unnecessary casting
Remove char/void __user * use.
Remove kmalloc cast.
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>
-rw-r--r-- | 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 46536b716acc..4807203827cc 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -3104,13 +3104,13 @@ static struct cont_t raw_cmd_cont = { | |||
3104 | .done = raw_cmd_done | 3104 | .done = raw_cmd_done |
3105 | }; | 3105 | }; |
3106 | 3106 | ||
3107 | static inline int raw_cmd_copyout(int cmd, char __user *param, | 3107 | static inline int raw_cmd_copyout(int cmd, void __user *param, |
3108 | struct floppy_raw_cmd *ptr) | 3108 | struct floppy_raw_cmd *ptr) |
3109 | { | 3109 | { |
3110 | int ret; | 3110 | int ret; |
3111 | 3111 | ||
3112 | while (ptr) { | 3112 | while (ptr) { |
3113 | ret = copy_to_user((void __user *)param, ptr, sizeof(*ptr)); | 3113 | ret = copy_to_user(param, ptr, sizeof(*ptr)); |
3114 | if (ret) | 3114 | if (ret) |
3115 | return -EFAULT; | 3115 | return -EFAULT; |
3116 | param += sizeof(struct floppy_raw_cmd); | 3116 | param += sizeof(struct floppy_raw_cmd); |
@@ -3148,7 +3148,7 @@ static void raw_cmd_free(struct floppy_raw_cmd **ptr) | |||
3148 | } | 3148 | } |
3149 | } | 3149 | } |
3150 | 3150 | ||
3151 | static inline int raw_cmd_copyin(int cmd, char __user *param, | 3151 | static inline int raw_cmd_copyin(int cmd, void __user *param, |
3152 | struct floppy_raw_cmd **rcmd) | 3152 | struct floppy_raw_cmd **rcmd) |
3153 | { | 3153 | { |
3154 | struct floppy_raw_cmd *ptr; | 3154 | struct floppy_raw_cmd *ptr; |
@@ -3157,12 +3157,11 @@ static inline int raw_cmd_copyin(int cmd, char __user *param, | |||
3157 | 3157 | ||
3158 | *rcmd = NULL; | 3158 | *rcmd = NULL; |
3159 | while (1) { | 3159 | while (1) { |
3160 | ptr = (struct floppy_raw_cmd *) | 3160 | ptr = kmalloc(sizeof(struct floppy_raw_cmd), GFP_USER); |
3161 | kmalloc(sizeof(struct floppy_raw_cmd), GFP_USER); | ||
3162 | if (!ptr) | 3161 | if (!ptr) |
3163 | return -ENOMEM; | 3162 | return -ENOMEM; |
3164 | *rcmd = ptr; | 3163 | *rcmd = ptr; |
3165 | ret = copy_from_user(ptr, (void __user *)param, sizeof(*ptr)); | 3164 | ret = copy_from_user(ptr, param, sizeof(*ptr)); |
3166 | if (ret) | 3165 | if (ret) |
3167 | return -EFAULT; | 3166 | return -EFAULT; |
3168 | ptr->next = NULL; | 3167 | ptr->next = NULL; |