mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-03 00:54:09 +08:00
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>
This commit is contained in:
parent
1ebddd85a6
commit
ce2f11fe78
@ -3104,13 +3104,13 @@ static struct cont_t raw_cmd_cont = {
|
|||||||
.done = raw_cmd_done
|
.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)
|
struct floppy_raw_cmd *ptr)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
while (ptr) {
|
while (ptr) {
|
||||||
ret = copy_to_user((void __user *)param, ptr, sizeof(*ptr));
|
ret = copy_to_user(param, ptr, sizeof(*ptr));
|
||||||
if (ret)
|
if (ret)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
param += sizeof(struct floppy_raw_cmd);
|
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 **rcmd)
|
||||||
{
|
{
|
||||||
struct floppy_raw_cmd *ptr;
|
struct floppy_raw_cmd *ptr;
|
||||||
@ -3157,12 +3157,11 @@ static inline int raw_cmd_copyin(int cmd, char __user *param,
|
|||||||
|
|
||||||
*rcmd = NULL;
|
*rcmd = NULL;
|
||||||
while (1) {
|
while (1) {
|
||||||
ptr = (struct floppy_raw_cmd *)
|
ptr = kmalloc(sizeof(struct floppy_raw_cmd), GFP_USER);
|
||||||
kmalloc(sizeof(struct floppy_raw_cmd), GFP_USER);
|
|
||||||
if (!ptr)
|
if (!ptr)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
*rcmd = ptr;
|
*rcmd = ptr;
|
||||||
ret = copy_from_user(ptr, (void __user *)param, sizeof(*ptr));
|
ret = copy_from_user(ptr, param, sizeof(*ptr));
|
||||||
if (ret)
|
if (ret)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
ptr->next = NULL;
|
ptr->next = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user